File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug65372.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Oct 14 08:02:49 2013 UTC (10 years, 11 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, HEAD
v 5.4.20

--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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>