dereference_014.phpt 511 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. Trying to create an object from dereferencing uninitialized variable
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL);
  6. class foo {
  7. public $x;
  8. static public $y;
  9. public function a() {
  10. return $this->x;
  11. }
  12. static public function b() {
  13. return self::$y;
  14. }
  15. }
  16. $foo = new foo;
  17. $h = $foo->a()[0]->a;
  18. var_dump($h);
  19. $h = foo::b()[1]->b;
  20. var_dump($h);
  21. ?>
  22. --EXPECTF--
  23. Notice: Trying to get property 'a' of non-object in %s on line %d
  24. NULL
  25. Notice: Trying to get property 'b' of non-object in %s on line %d
  26. NULL