bug30820.phpt 652 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Bug #30820 (static member conflict with $this->member silently ignored)
  3. --INI--
  4. error_reporting=4095
  5. opcache.optimization_level=0
  6. --FILE--
  7. <?php
  8. class Blah {
  9. private static $x;
  10. public function show() {
  11. Blah::$x = 1;
  12. $this->x = 5; // no warning, but refers to different variable
  13. echo 'Blah::$x = '. Blah::$x ."\n";
  14. echo '$this->x = '. $this->x ."\n";
  15. }
  16. }
  17. $b = new Blah();
  18. $b->show();
  19. ?>
  20. --EXPECTF--
  21. Notice: Accessing static property Blah::$x as non static in %sbug30820.php on line 7
  22. Blah::$x = 1
  23. Notice: Accessing static property Blah::$x as non static in %sbug30820.php on line 10
  24. $this->x = 5