php-src/Zend/tests/bug29883.phpt
Rudi Theunissen 30156d588c Fixed bug #63217
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.
2018-07-02 16:41:59 +02:00

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"