Migración de PHP 7.0.x a PHP 7.1.x
PHP Manual

Cambios retroincompatibles

Lanzmiento de una excepción al pasar muy pocos argumentos a una función

Anteriormente, se emitía una advertencia al invocar funciones definidas por el usuario con muy pocos argumentos. Ahora, esta advertencia ha sido promovida a una excepción de tipo Error. Este cambio solamente se aplica a funciones definidas por el usuario, no a funciones internas. Por ejemplo:

<?php
function test($param){}
test();

Salida del ejemplo anterior en PHP 5.5:

Uncaught Error: Too few arguments to function test(), 0 passed in %s on line %d and exactly 1 expected in %s:%d

Forbid dynamic calls to scope introspection functions

Dynamic calls for certain functions have been forbidden (in the form of $func() or array_map('extract', ...), etc). These functions either inspect or modify another scope, and present with them ambiguous and unreliable behavior. The functions are as follows:

<?php
(function () {
    
'func_num_args'();
})();

El resultado del ejemplo sería:

Warning: Cannot call func_num_args() dynamically in %s on line %d

Invalid class, interface, and trait names

The following names cannot be used to name classes, interfaces, or traits:

Numerical string conversions now respect scientific notation

Integer operations and conversions on numerical strings now respect scientific notation. This also includes the (int) cast operation, and the following functions: intval() (where the base is 10), settype(), decbin(), decoct(), and dechex().

Fixes to mt_rand() algorithm

mt_rand() will now default to using the fixed version of the Mersenne Twister algorithm. If deterministic output from mt_srand() was relied upon, then the MT_RAND_PHP with the ability to preserve the old (incorrect) implementation via an additional optional second parameter to mt_srand().

rand() aliased to mt_rand() and srand() aliased to mt_srand()

rand() and srand() have now been made aliases to mt_rand() and mt_srand(), respectively. This means that the output for the following functions have changes: rand(), shuffle(), str_shuffle(), and array_rand().

Disallow the ASCII delete control character in identifiers

The ASCII delete control character (0x7F) can no longer be used in identifiers that are not quoted.

error_log changes with syslog value

If the error_log ini setting is set to syslog, the PHP error levels are mapped to the syslog error levels. This brings finer differentiation in the error logs in contrary to the previous approach where all the errors are loggged with the notice level only.

Do not call destructors on incomplete objects

Destructors are no longer called upon incomplete objects (such as throwing an exception in the constructor).

call_user_func() fails on calls to functions with reference arguments

call_user_func() will now always fail upon calls to functions that expect references as arguments.

Removed ini directives

The following ini directives have been removed:


Migración de PHP 7.0.x a PHP 7.1.x
PHP Manual