php-src/Zend/tests/unset_cv10.phpt
Nikita Popov 71fb83567f Fix bug #80945: Don't throw undefined array key warning in ArrayObject unset()
This makes the behavior of ArrayObject the same as far plain
arrays, which don't throw a warning when unsetting a key that
already doesn't exit.
2021-06-14 10:14:38 +02:00

17 lines
308 B
PHP

--TEST--
unset() CV 10 (unset() of global variable in ArrayObject::offsetUnset($GLOBALS))
--FILE--
<?php
/* This is working on a copy of $GLOBALS, so nothing interesting happens here. */
$a = new ArrayObject($GLOBALS);
$x = "ok\n";
echo $x;
$a->offsetUnset('x');
echo $x;
echo "ok\n";
?>
--EXPECT--
ok
ok
ok