mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Zend: Deprecate __sleep() (#19682)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods
This commit is contained in:
committed by
GitHub
parent
0e2c991767
commit
f18e99244b
@@ -18,5 +18,7 @@ $data = serialize($foo);
|
||||
var_dump(str_replace("\0", '\0', $data));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
|
||||
Warning: serialize(): "no_such" returned as member variable from __sleep() but does not exist in %s on line %d
|
||||
string(114) "O:3:"foo":3:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";}"
|
||||
|
||||
@@ -19,5 +19,6 @@ class bar extends foo
|
||||
|
||||
var_dump(str_replace("\0", '\0', serialize(new bar())));
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
Deprecated: The __sleep() serialization magic method has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
|
||||
string(114) "O:3:"bar":3:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";}"
|
||||
|
||||
Reference in New Issue
Block a user