What are the new features of PHP7.3 version
This article mainly introduces "what are the new features of the PHP7.3 version". In the daily operation, I believe that many people have doubts about the new features of the PHP7.3 version. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what are the new features of the PHP7.3 version?" Next, please follow the editor to study!
Is_countable rfc
PHP 7.2adds a warning when counting uncountable objects. The is_countable function can help prevent this warning.
$count = is_countable ($variable)? Count ($variable): null;array_key_first and array_key_last rfc
These two functions can basically operate as the name says.
$array = ['a'= > '…' ,'b'= >'.' ,'c'= >'.' ,]; array_key_first ($array); / / 'a'array_key_last ($array); / /' c'
The original RFC also proposed array_value_first and array_value_last, but these were opposed by most people.
The other array_first and array_last are returned as a tuple [$key = > $value]. Currently, we only have two functions to get the first and last keys of the array.
Flexible Heredoc syntax rfc
Heredoc can be a useful tool for larger strings, although they used to have a quirk of indentation.
/ / Instead of this:$query =