Backward Incompatible ChangesPHP CoreHeredoc/Nowdoc Ending Label InterpretationDue to the introduction of flexible heredoc/nowdoc syntax, doc strings that contain the ending label inside their body may cause syntax errors or change in interpretation. For example in:
FOO did not previously have any
special meaning. Now it will be interpreted as the end of the heredoc string
and the following FOO; will cause a syntax error. This issue can
always be resolved by choosing an ending label that does not occur within the
contents of the string.
Continue Targeting Switch issues Warning
Strict Interpretation of Integer String Keys on ArrayAccess
Array accesses of type Static Properties no longer separated by Reference AssignmentIn PHP, static properties are shared between inheriting classes, unless the static property is explicitly overridden in a child class. However, due to an implementation artifact it was possible to separate the static properties by assigning a reference. This loophole has been fixed.
References returned by Array and Property Accesses are immediately unwrappedReferences returned by array and property accesses are now unwrapped as part of the access. This means that it is no longer possible to modify the reference between the access and the use of the accessed value:
Argument Unpacking of Traversables with non-Integer Keys no longer supportedArgument unpacking stopped working with Traversables with non-integer keys. The following code worked in PHP 5.6-7.2 by accident.
MiscellaneousThe ext_skel utility has been completely redesigned with new options and some old options removed. This is now written in PHP and has no external dependencies. Support for BeOS has been dropped.
Exceptions thrown due to automatic conversion of warnings into exceptions in
TypeError now reports wrong types as
Undefined variables passed to compact will now be reported as a notice.
getimagesize and related functions now report the mime
type of BMP images as
stream_socket_get_name will now return IPv6 addresses
wrapped in brackets. For example BCMath Arbitrary Precision MathematicsAll warnings thrown by BCMath functions are now using PHP's error handling. Formerly some warnings have directly been written to stderr. bcmul and bcpow now return numbers with the requested scale. Formerly, the returned numbers may have omitted trailing decimal zeroes. IMAP, POP3 and NNTPrsh/ssh logins are disabled by default. Use imap.enable_insecure_rsh if you want to enable them. Note that the IMAP library does not filter mailbox names before passing them to the rsh/ssh command, thus passing untrusted data to this function with rsh/ssh enabled is insecure. Multibyte String
Due to added support for named captures, MySQL Improved Extension
Prepared statements now properly report the fractional seconds for
MySQL Functions (PDO_MYSQL)
Prepared statements now properly report the fractional seconds for
Reflection
Reflection export to string now uses
Standard PHP Library (SPL)If an SPL autoloader throws an exception, following autoloaders will not be executed. Previously all autoloaders were executed and exceptions were chained. SimpleXMLMathematic operations involving SimpleXML objects will now treat the text as an int or float, whichever is more appropriate. Previously values were treated as ints unconditionally. Incoming CookiesAs of PHP 7.3.23, the names of incoming cookies are no longer url-decoded for security reasons. |