php-src/Zend/tests/objects_034.phpt

38 lines
568 B
Plaintext
Raw Normal View History

2021-12-03 10:40:17 +00:00
--TEST--
Array object clobbering by user error handler
--FILE--
<?php
class A implements ArrayAccess {
public function &offsetGet($n): mixed {
return null;
}
public function offsetSet($n, $v): void {
}
public function offsetUnset($n): void {
}
public function offsetExists($n): bool {
return false;
}
2021-12-03 10:40:17 +00:00
}
set_error_handler(function () {
$GLOBALS['a'] = null;
});
$a = new A;
$a[$c] = 'x' ;
var_dump($a);
$a = new A;
$a[$c] .= 'x' ;
var_dump($a);
$a = new A;
$a[$c][$c] = 'x' ;
var_dump($a);
?>
--EXPECT--
NULL
NULL
NULL