Backward incompatible changes
Throw on passing too few function arguments
Previously, a warning would be emitted for invoking user-defined functions
with too few arguments. Now, this warning has been promoted to an Error
exception. This change only applies to user-defined functions, not internal
functions. For example:
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:
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().
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 logged with the
notice level only.
Do not call destructors on incomplete objects
Destructors are now never called for objects that throw an exception during
the execution of their constructor. In previous versions this behavior
depended on whether the object was referenced outside the construcor (e.g.
by an exception backtrace).
call_user_func() will now always generate a warning
upon calls to functions that expect references as arguments. Previously
this depended on whether the call was fully qualified.
Additionally, call_user_func() and
call_user_func_array() will no longer abort the function
call in this case. The "expected reference" warning will be emitted, but the
call will proceed as usual.
The empty index operator is not supported for strings anymore
Applying the empty index operator to a string (e.g. $str[] = $x)
throws a fatal error instead of converting silently to array.
Removed ini directives
The following ini directives have been removed:
-
session.entropy_file
-
session.entropy_length
-
session.hash_function
-
session.hash_bits_per_character
Array ordering when elements are automatically created during by reference
assignments has changed
The order of the elements in an array has changed when those elements have
been automatically created by referencing them in a by reference
assignment. For example:
Sort order of equal elements
The internal sorting algorithm has been improved, what may result in
different sort order of elements, which compare as equal, than before.
Note:
Don't rely on the order of elements which compare as equal; it might change
anytime.