Annotation of embedaddon/php/Zend/tests/bug51822.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #51822 (Segfault with strange __destruct() for static class variables)
        !             3: --FILE--
        !             4: <?php
        !             5: class DestructableObject
        !             6: {
        !             7:        public function __destruct()
        !             8:        {
        !             9:                echo "2\n";
        !            10:        }       
        !            11: }
        !            12: 
        !            13: class DestructorCreator
        !            14: {
        !            15:        public function __destruct()
        !            16:        {
        !            17:                $this->test = new DestructableObject;   
        !            18:                echo "1\n";
        !            19:        }
        !            20: }
        !            21: 
        !            22: class Test
        !            23: {
        !            24:        public static $mystatic;
        !            25: }
        !            26: 
        !            27: // Uncomment this to avoid segfault
        !            28: //Test::$mystatic = new DestructorCreator();
        !            29: 
        !            30: $x = new Test();
        !            31: 
        !            32: if (!isset(Test::$mystatic))
        !            33:        Test::$mystatic = new DestructorCreator();
        !            34: 
        !            35: echo "bla\n";
        !            36: ?>
        !            37: --EXPECT--
        !            38: bla
        !            39: 1
        !            40: 2

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