mirror of
https://github.com/php/php-src.git
synced 2024-12-25 01:40:50 +08:00
41 lines
729 B
PHP
41 lines
729 B
PHP
--TEST--
|
|
Bug #65372 (Segfault in gc_zval_possible_root when return reference fails)
|
|
--FILE--
|
|
<?php
|
|
|
|
class ParentClass
|
|
{
|
|
private static $_OBJECTS;
|
|
|
|
public static function Get()
|
|
{
|
|
self::$_OBJECTS[1] = new ChildClass();
|
|
return self::$_OBJECTS[1];
|
|
}
|
|
}
|
|
|
|
class ChildClass extends ParentClass
|
|
{
|
|
public $Manager;
|
|
|
|
function __construct()
|
|
{
|
|
$this->Manager = $this;
|
|
}
|
|
|
|
public static function &GetCurrent()
|
|
{
|
|
return ChildClass::Get();
|
|
}
|
|
|
|
public static function &Get()
|
|
{
|
|
return parent::Get();
|
|
}
|
|
}
|
|
|
|
$staff = ChildClass::GetCurrent();
|
|
?>
|
|
--EXPECTF--
|
|
Notice: Only variable references should be returned by reference in %sbug65372.php on line 30
|