mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
71fb83567f
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.
17 lines
308 B
PHP
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
|