Annotation of embedaddon/php/Zend/tests/bug64896.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects)
                      3: --XFAIL--
                      4: We can not fix this bug without a significant (performace slow down) change to gc
                      5: --FILE--
                      6: <?php
                      7: $bar = NULL;
                      8: class bad
                      9: {
                     10:        private $_private = array();
                     11: 
                     12:        public function __construct()
                     13:        {
                     14:                $this->_private[] = 'php';
                     15:        }
                     16: 
                     17:        public function __destruct()
                     18:        {
                     19:                global $bar;
                     20:                $bar = $this;
                     21:        }
                     22: }
                     23: 
                     24: $foo = new stdclass;
                     25: $foo->foo = $foo;
                     26: $foo->bad = new bad;
                     27: 
                     28: gc_disable();
                     29: 
                     30: unserialize(serialize($foo));
                     31: gc_collect_cycles();
                     32: var_dump($bar); 
                     33: /*  will output:
                     34: object(bad)#4 (1) {
                     35:   ["_private":"bad":private]=>
                     36:   &UNKNOWN:0
                     37: }
                     38: */
                     39: ?>
                     40: --EXPECTF--
                     41: bject(bad)#%d (1) {
                     42:   ["_private":"bad":private]=>
                     43:   array(1) {
                     44:     [0]=>
                     45:     string(3) "php"
                     46:   }
                     47: }

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