bug30346.phpt 503 B

12345678910111213141516171819202122
  1. --TEST--
  2. Bug #30346 (arrayAccess and using $this)
  3. --FILE--
  4. <?php
  5. class Test implements ArrayAccess
  6. {
  7. public function __construct() { }
  8. public function offsetExists( $offset ): bool { return false; }
  9. public function offsetGet( $offset ): mixed { return $offset; }
  10. public function offsetSet( $offset, $data ): void { }
  11. public function offsetUnset( $offset ): void { }
  12. }
  13. $post = new Test;
  14. $id = 'page';
  15. echo $post[$id.'_show'];
  16. echo "\n";
  17. ?>
  18. --EXPECT--
  19. page_show