Annotation of embedaddon/php/ext/standard/tests/serialize/bug14293.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #14293 (serialize() and __sleep())
                      3: --FILE--
                      4: <?php 
                      5: class t
                      6: {
                      7:        function t()
                      8:        {
                      9:                $this->a = 'hello';
                     10:        }
                     11: 
                     12:        function __sleep()
                     13:        {
                     14:                echo "__sleep called\n";
                     15:                return array('a','b');
                     16:        }       
                     17: }
                     18: 
                     19: $t = new t();
                     20: $data = serialize($t);
                     21: echo "$data\n";
                     22: $t = unserialize($data);
                     23: var_dump($t);
                     24: 
                     25: ?>
                     26: --EXPECTF--
                     27: __sleep called
                     28: 
                     29: Notice: serialize(): "b" returned as member variable from __sleep() but does not exist in %sbug14293.php on line %d
                     30: O:1:"t":2:{s:1:"a";s:5:"hello";s:1:"b";N;}
                     31: object(t)#%d (2) {
                     32:   ["a"]=>
                     33:   string(5) "hello"
                     34:   ["b"]=>
                     35:   NULL
                     36: }

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