--TEST-- Object test, __sleep --SKIPIF-- = 0) { echo "skip tests in PHP 5.1 or older"; } --FILE-- a = $a; $this->b = $b; $this->c = $c; $this->d = $d; } function __sleep() { return array('a', 'b', 'c'); } # function __wakeup() { # $this->d = $this->a + $this->b + $this->c; # } } $o = new Obj(1, 2, 3, 4); test('object', $o, true); ?> --EXPECTF-- object 84c0a34f626aa16101a4002a006202a6004f626a006303 object(Obj)#%d (4) { ["a"]=> int(1) ["b:protected"]=> int(2) ["c:private"]=> int(3) ["d"]=> NULL } OK