mirror of
https://github.com/php/php-src.git
synced 2024-12-21 16:00:18 +08:00
30156d588c
Don't automatically convert literal string keys to integers on array access, as we may be dealing with an ArrayAccess object, rather than a plain array.
22 lines
381 B
PHP
22 lines
381 B
PHP
--TEST--
|
|
Bug #29883 (isset gives invalid values on strings)
|
|
--FILE--
|
|
<?php
|
|
$x = "bug";
|
|
var_dump(isset($x[-10]));
|
|
var_dump(isset($x[1]));
|
|
var_dump(isset($x["1"]));
|
|
var_dump($x[-10])."\n";
|
|
var_dump($x[1])."\n";
|
|
var_dump($x["1"])."\n";
|
|
?>
|
|
--EXPECTF--
|
|
bool(false)
|
|
bool(true)
|
|
bool(true)
|
|
|
|
Notice: Uninitialized string offset: -10 in %s on line 6
|
|
string(0) ""
|
|
string(1) "u"
|
|
string(1) "u"
|