objects_035.phpt 453 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Array object clobbering by user error handler
  3. --FILE--
  4. <?php
  5. class 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. set_error_handler(function () {
  18. $GLOBALS['a'] = null;
  19. });
  20. $a = new A;
  21. $a[$c];
  22. ?>
  23. DONE
  24. --EXPECT--
  25. DONE