xref: /PHP-8.0/ext/spl/tests/bug66127.phpt (revision c48b745f)
1--TEST--
2Bug #66127 (Segmentation fault with ArrayObject unset)
3--INI--
4error_reporting = E_ALL & ~E_NOTICE
5--FILE--
6<?php
7function crash()
8{
9    set_error_handler(function () {});
10    $var = 1;
11    trigger_error('error');
12    $var2 = $var;
13    $var3 = $var;
14    trigger_error('error');
15}
16
17$items = new ArrayObject();
18
19unset($items[0]);
20unset($items[0][0]);
21crash();
22echo "Worked!\n";
23?>
24--EXPECTF--
25Warning: Undefined array key 0 in %s on line %d
26Worked!
27