bug65372.phpt 725 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. Bug #65372 (Segfault in gc_zval_possible_root when return reference fails)
  3. --FILE--
  4. <?php
  5. class ParentClass
  6. {
  7. private static $_OBJECTS;
  8. public static function Get()
  9. {
  10. self::$_OBJECTS[1] = new ChildClass();
  11. return self::$_OBJECTS[1];
  12. }
  13. }
  14. class ChildClass extends ParentClass
  15. {
  16. public $Manager;
  17. function __construct()
  18. {
  19. $this->Manager = $this;
  20. }
  21. public static function &GetCurrent()
  22. {
  23. return ChildClass::Get();
  24. }
  25. public static function &Get()
  26. {
  27. return parent::Get();
  28. }
  29. }
  30. $staff = ChildClass::GetCurrent();
  31. ?>
  32. --EXPECTF--
  33. Notice: Only variable references should be returned by reference in %sbug65372.php on line 30