diff options
author | George Peter Banyard <girgias@php.net> | 2020-07-29 02:51:09 +0100 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2020-07-29 02:51:09 +0100 |
commit | b2248789ed21300aaf356336bf43b6b065183fcb (patch) | |
tree | c61dba0a43f72d27904e956318f911c7dc719dda /UPGRADING | |
parent | f759936591c08d9bff6ab707f2f8c192f61b5bf1 (diff) | |
download | php-git-b2248789ed21300aaf356336bf43b6b065183fcb.tar.gz |
Implement 'Saner Numeric Strings' RFC:
RFC: https://wiki.php.net/rfc/saner-numeric-strings
This removes the -1 allow_error mode from is_numeric_string functions and replaces it by
a trailing boolean out argument to preserve BC in a couple of places.
Most of the changes can be resumed to "numeric" strings which emitted a E_NOTICE now emit
a E_WARNING and "numeric" strings which emitted a E_WARNING now throw a TypeError.
This mostly affects:
- String offsets
- Arithmetic operations
- Bitwise operations
Closes GH-5762
Diffstat (limited to 'UPGRADING')
-rw-r--r-- | UPGRADING | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -217,6 +217,27 @@ PHP 8.0 UPGRADE NOTES . debug_backtrace() and Exception::getTrace() will no longer provide references to arguments. It will not be possible to change function arguments through the backtrace. + . The concept of numeric-string has been altered to be less error prone. + Trailing whitespaces are now allowed in numeric strings making it symmetric + with how leading whitespaces were treated. + This mostly affects: + - The is_numeric() function + - String-to-string comparisons + - Type declarations + - Increment and Decrement operations + The concept of "leading-numeric string" has been mostly dropped, the cases + where this concept remains is in order to ease migration. + String which emitted an E_NOTICE "A non well formed numeric value encountered" + will now emit an E_WARNING "A non-numeric value encountered" + and all strings which emitted an E_WARNING "A non-numeric value encountered" + will now throw a TypeError. + This mostly affects: + - Arithmetic operations + - Bitwise operations + This E_WARNING to TypeError change also affects the E_WARNING + "Illegal string offset 'string'" for illegal string offsets. + This does not change the behaviour of explicit casts to int/float from strings. + RFC: https://wiki.php.net/rfc/saner-numeric-strings - COM: . Removed the ability to import case-insensitive constants from type |