Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the new features of PHP7.3 version

Shulou Source: shulou.com Published: 2022-06-03 19:06:16 11月12日 Update

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 =

Tags: Functions versions properties characters strings learning errors help support two variables arrays methods more useful tags syntax search original same Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information OPPO Reno Apple vpn Shulou Technology