Annotation of embedaddon/php/tests/classes/bug26737.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #26737 (Protected and private variables are not saved on serialization when a user defined __sleep is used)
        !             3: --FILE--
        !             4: <?php
        !             5: class foo
        !             6: {
        !             7:        private $private = 'private';
        !             8:        protected $protected = 'protected';
        !             9:        public $public = 'public';
        !            10: 
        !            11:        public function __sleep()
        !            12:        {
        !            13:                return array('private', 'protected', 'public', 'no_such');
        !            14:        }
        !            15: }
        !            16: $foo = new foo();
        !            17: $data = serialize($foo);
        !            18: var_dump(str_replace("\0", '\0', $data));
        !            19: ?>
        !            20: --EXPECTF--
        !            21: Notice: serialize(): "no_such" returned as member variable from __sleep() but does not exist in %s on line %d
        !            22: string(130) "O:3:"foo":4:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";s:7:"no_such";N;}"

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