bug33710.phpt 556 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Bug #33710 (ArrayAccess objects doesn't initialize $this)
  3. --FILE--
  4. <?php
  5. class Foo implements ArrayAccess
  6. {
  7. function offsetExists($offset): bool { return true;}
  8. function offsetGet($offset): mixed { return null; }
  9. function offsetSet($offset, $value): void {/*...*/}
  10. function offsetUnset($offset): void {/*...*/}
  11. function fail()
  12. {
  13. $this['blah'];
  14. }
  15. function succeed()
  16. {
  17. $this;
  18. $this['blah'];
  19. }
  20. }
  21. $bar = new Foo();
  22. $bar->succeed();
  23. $bar->fail();
  24. ?>
  25. ===DONE===
  26. --EXPECT--
  27. ===DONE===