mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
b2248789ed
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
17 lines
343 B
PHP
17 lines
343 B
PHP
--TEST--
|
|
Crash on $x['2x']['y'] += 1 when $x is string
|
|
--FILE--
|
|
<?php
|
|
$x = "a";
|
|
$x['2x']['y'] += 1;
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Illegal string offset "2x" in %s on line %d
|
|
|
|
Fatal error: Uncaught Error: Cannot use string offset as an array in %soffset_assign.php:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %soffset_assign.php on line %d
|