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 (11 years, 6 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

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

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