mirror of
https://github.com/php/php-src.git
synced 2024-09-24 03:17:26 +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
26 lines
664 B
PHP
26 lines
664 B
PHP
--TEST--
|
|
testing the behavior of string offset chaining
|
|
--FILE--
|
|
<?php
|
|
$array = array('expected_array' => "foobar");
|
|
var_dump(isset($array['expected_array']));
|
|
var_dump($array['expected_array']);
|
|
var_dump(isset($array['expected_array']['foo']));
|
|
var_dump($array['expected_array']['0foo']);
|
|
var_dump(isset($array['expected_array']['foo']['bar']));
|
|
var_dump($array['expected_array']['0foo']['0bar']);
|
|
?>
|
|
--EXPECTF--
|
|
bool(true)
|
|
string(6) "foobar"
|
|
bool(false)
|
|
|
|
Warning: Illegal string offset "0foo" in %s on line %d
|
|
string(1) "f"
|
|
bool(false)
|
|
|
|
Warning: Illegal string offset "0foo" in %s on line %d
|
|
|
|
Warning: Illegal string offset "0bar" in %s on line %d
|
|
string(1) "f"
|