php-src/Zend/tests/objects_035.phpt
Dmitry Stogov 76075823e7 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix array clobering by user error handler
2021-12-13 15:20:16 +03:00

28 lines
453 B
PHP

--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;
}
}
set_error_handler(function () {
$GLOBALS['a'] = null;
});
$a = new A;
$a[$c];
?>
DONE
--EXPECT--
DONE