mirror of
https://github.com/php/php-src.git
synced 2026-03-26 01:02:25 +01:00
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
21 lines
392 B
PHP
21 lines
392 B
PHP
--TEST--
|
|
Bug #73792 (invalid foreach loop hangs script)
|
|
--FILE--
|
|
<?php
|
|
$a = 'aaa';
|
|
|
|
foreach ($a['2bbb'] as &$value) {
|
|
echo 'loop';
|
|
}
|
|
|
|
unset($value);
|
|
echo 'done';
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Illegal string offset "2bbb" in %s on line %d
|
|
|
|
Fatal error: Uncaught Error: Cannot iterate on string offsets by reference in %sbug73792.php:4
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %sbug73792.php on line 4
|