1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/spl/tests/bug66127.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

26 lines
407 B
PHP

--TEST--
Bug #66127 (Segmentation fault with ArrayObject unset)
--INI--
error_reporting = E_ALL & ~E_NOTICE
--FILE--
<?php
function crash()
{
set_error_handler(function () {});
$var = 1;
trigger_error('error');
$var2 = $var;
$var3 = $var;
trigger_error('error');
}
$items = new ArrayObject();
unset($items[0]);
unset($items[0][0]);
crash();
echo "Worked!\n";
?>
--EXPECT--
Worked!