diff options
author | Andrey Hristov <andrey@php.net> | 2004-08-21 13:49:19 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2004-08-21 13:49:19 +0000 |
commit | dd5538566e83eba0edde9a29eef1e80d5092f4b5 (patch) | |
tree | 7ba5ac7fbbd12ace2a4ca7dec51c8d61845b7929 /tests | |
parent | e398e6b7d67c5342c5c9fe02b4a4ee8e043a9563 (diff) | |
download | php-git-dd5538566e83eba0edde9a29eef1e80d5092f4b5.tar.gz |
fix for bug 26737 : private & protected member variables not serialized
when user defined __sleep() is declared. Additionally E_NOTICE is
being thrown if __sleep() returns a non-existing member variable name
Diffstat (limited to 'tests')
-rw-r--r-- | tests/classes/bug26737.phpt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/classes/bug26737.phpt b/tests/classes/bug26737.phpt index 2fbcca3829..e190318ffd 100644 --- a/tests/classes/bug26737.phpt +++ b/tests/classes/bug26737.phpt @@ -10,12 +10,13 @@ class foo public function __sleep() { - return array('private', 'protected', 'public'); + return array('private', 'protected', 'public', 'no_such'); } } $foo = new foo(); $data = serialize($foo); var_dump(str_replace("\0", '\0', $data)); ?> ---EXPECT-- -string(76) "O:3:"foo":3:{s:7:"private";N;s:9:"protected";R:2;s:6:"public";s:6:"public";}" +--EXPECTF-- +Notice: serialize(): "no_such" returned as member variable from __sleep() but does not exist in %s on line %d +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;}" |