bug65911.phpt 433 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #65911 (scope resolution operator - strange behavior with $this)
  3. --FILE--
  4. <?php
  5. class A {}
  6. class B
  7. {
  8. public function go()
  9. {
  10. $this->foo = 'bar';
  11. echo A::$this->foo; // should not output 'bar'
  12. }
  13. }
  14. $obj = new B();
  15. $obj->go();
  16. ?>
  17. --EXPECTF--
  18. Fatal error: Uncaught Error: Access to undeclared static property A::$this in %s:%d
  19. Stack trace:
  20. #0 %s(%d): B->go()
  21. #1 {main}
  22. thrown in %s on line %d