Home >Backend Development >PHP Problem >What is php-5.6?
php-5.6 refers to the official version of PHP5.6 that has been released. The new features of PHP5.6 include scalar operations on constants, parameter calling improvements, split parameters, _debuginfo(), etc.
#The operating environment of this article: Windows 7 system, php-5.6 version, Dell G3 computer.
What is php-5.6?
represents the official version of PHP5.6. The new version adds some practical new features and discards some redundant functions. At the same time, some original functions have also been improved. Let’s take a look at the differences between the official version of PHP 5.6!
Improvements made by the new version based on the old version
PHP 5.6 has made many improvements to the old version of PHP. However, most of the PHP5 code can run normally without modification in the new version of PHP.
json_decode function
According to JSON specifications, the json_decode() function will automatically exclude all non-lowercase variables in the JSON text (such as: true, false, null, etc.), and will also modify json_last_error accordingly. () variables in the function.
GMP resources
In PHP 5.6, GMP resources are objects (Object). If the is_resource() function is not used, there is no need to modify any existing code.
Array values and overwriting
In versions prior to PHP 5.6, when you declare an array within a Class, the array value will be overwritten in some cases
New features in PHP 5.6
Scalar operations on constants
In PHP 5.6 version, constants containing numbers and strings can be implemented for scalar operations (Scalar Expression) . As shown below:
Parameter calling improvements
In previous versions, we used the func_get_args() function to call all available parameters. In PHP 5.6, the above operation can be completed through the string "...".
Split Parameters
We can also use the string "..." to open the parameters in any array.
_debuginfo()
In PHP 5.6, when using the var_dump() function to output an object, the properties and values of the object can be changed.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What is php-5.6?. For more information, please follow other related articles on the PHP Chinese website!