mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +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
17 lines
341 B
PHP
17 lines
341 B
PHP
--TEST--
|
|
Bug #29566 (foreach/string handling strangeness)
|
|
--FILE--
|
|
<?php
|
|
$var="This is a string";
|
|
|
|
$dummy="";
|
|
unset($dummy);
|
|
|
|
foreach($var['0nosuchkey'] as $v) {
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Illegal string offset "0nosuchkey" in %s on line %d
|
|
|
|
Warning: foreach() argument must be of type array|object, string given in %sbug29566.php on line %d
|