xref: /PHP-8.1/Zend/tests/objects_035.phpt (revision cbc0b1af)
1--TEST--
2Array object clobbering by user error handler
3--FILE--
4<?php
5class A implements ArrayAccess {
6    public function &offsetGet($n): mixed {
7    	return null;
8    }
9    public function offsetSet($n, $v): void {
10    }
11    public function offsetUnset($n): void {
12    }
13    public function offsetExists($n): bool {
14    	return false;
15    }
16}
17
18set_error_handler(function () {
19    $GLOBALS['a'] = null;
20});
21
22$a = new A;
23$a[$c];
24?>
25DONE
26--EXPECT--
27DONE
28