mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
76075823e7
* PHP-8.0: Fix array clobering by user error handler
28 lines
453 B
PHP
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
|