bug52484_3.phpt 394 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Bug #52484.3 (__set() ignores setting properties with empty names)
  3. --FILE--
  4. <?php
  5. class A {
  6. function __get($prop) {
  7. var_dump($this->$prop);
  8. }
  9. }
  10. $a = new A();
  11. $prop = "\0";
  12. var_dump($a->$prop);
  13. ?>
  14. --EXPECTF--
  15. Fatal error: Uncaught Error: Cannot access property starting with "\0" in %s:%d
  16. Stack trace:
  17. #0 %s(%d): A->__get('\x00')
  18. #1 {main}
  19. thrown in %s on line %d