diff --git a/Zend/tests/enum/__sleep.phpt b/Zend/tests/enum/__sleep.phpt index 4da08e6a4d3f2..d3345e39bd47a 100644 --- a/Zend/tests/enum/__sleep.phpt +++ b/Zend/tests/enum/__sleep.phpt @@ -13,4 +13,6 @@ enum Foo { ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Fatal error: Enum Foo cannot include magic method __sleep in %s on line %d diff --git a/Zend/tests/enum/__wakeup.phpt b/Zend/tests/enum/__wakeup.phpt index 8aea17ae53fd3..60d5971ab3580 100644 --- a/Zend/tests/enum/__wakeup.phpt +++ b/Zend/tests/enum/__wakeup.phpt @@ -13,4 +13,6 @@ enum Foo { ?> --EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Fatal error: Enum Foo cannot include magic method __wakeup in %s on line %d diff --git a/Zend/tests/lazy_objects/oss_fuzz_71446.phpt b/Zend/tests/lazy_objects/oss_fuzz_71446.phpt index ae2db55c73fc1..6209e29885c96 100644 --- a/Zend/tests/lazy_objects/oss_fuzz_71446.phpt +++ b/Zend/tests/lazy_objects/oss_fuzz_71446.phpt @@ -20,3 +20,4 @@ $obj = $reflector->newLazyProxy(function() { serialize($obj); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d diff --git a/Zend/tests/lazy_objects/serialize___sleep.phpt b/Zend/tests/lazy_objects/serialize___sleep.phpt index d21f0fe09c97d..bdd34baf37691 100644 --- a/Zend/tests/lazy_objects/serialize___sleep.phpt +++ b/Zend/tests/lazy_objects/serialize___sleep.phpt @@ -36,6 +36,7 @@ try { ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d Init on serialize and successful initialization string(27) "O:1:"C":1:{s:4:"%0C%0b";i:1;}" Init on serialize and failed initialization diff --git a/Zend/tests/lazy_objects/serialize___sleep_initializes.phpt b/Zend/tests/lazy_objects/serialize___sleep_initializes.phpt index ec7657afc6916..e505272881b41 100644 --- a/Zend/tests/lazy_objects/serialize___sleep_initializes.phpt +++ b/Zend/tests/lazy_objects/serialize___sleep_initializes.phpt @@ -37,6 +37,7 @@ $obj = $reflector->newLazyProxy(function ($obj) { test('Proxy', $obj); --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d # Ghost: string(11) "initializer" string(24) "O:1:"C":1:{s:1:"a";i:1;}" diff --git a/Zend/tests/lazy_objects/serialize___sleep_skip_flag.phpt b/Zend/tests/lazy_objects/serialize___sleep_skip_flag.phpt index 4641fb2a49ac3..55a7aeb6dc2da 100644 --- a/Zend/tests/lazy_objects/serialize___sleep_skip_flag.phpt +++ b/Zend/tests/lazy_objects/serialize___sleep_skip_flag.phpt @@ -35,6 +35,7 @@ $obj = $reflector->newLazyProxy(function ($obj) { test('Proxy', $obj); --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d # Ghost: string(12) "O:1:"C":0:{}" object(C)#%d (0) { diff --git a/Zend/tests/lazy_objects/serialize___sleep_skip_flag_may_initialize.phpt b/Zend/tests/lazy_objects/serialize___sleep_skip_flag_may_initialize.phpt index ed909a875de47..ea0e75536e730 100644 --- a/Zend/tests/lazy_objects/serialize___sleep_skip_flag_may_initialize.phpt +++ b/Zend/tests/lazy_objects/serialize___sleep_skip_flag_may_initialize.phpt @@ -38,6 +38,7 @@ $obj = $reflector->newLazyProxy(function ($obj) { test('Proxy', $obj); --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d # Ghost: string(11) "initializer" int(1) diff --git a/Zend/tests/serialize/bug34045.phpt b/Zend/tests/serialize/bug34045.phpt index 61886cf354b67..14aa55fea52a3 100644 --- a/Zend/tests/serialize/bug34045.phpt +++ b/Zend/tests/serialize/bug34045.phpt @@ -24,5 +24,6 @@ $db_str = serialize($db); $db2 = unserialize($db_str); echo "ok\n"; ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d ok diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index eb2286b932959..ef058d39b67dc 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -9272,6 +9272,15 @@ static void zend_compile_class_decl(znode *result, zend_ast *ast, bool toplevel) ce->ce_flags |= ZEND_ACC_TOP_LEVEL; } + if (UNEXPECTED(zend_hash_exists(&ce->function_table, ZSTR_KNOWN(ZEND_STR_SLEEP)) && ce->__serialize == NULL)) { + zend_error(E_DEPRECATED, "The __sleep() serialization hook has been deprecated." + " Implement __serialize() instead (or in addition, if support for old PHP versions is necessary)"); + } + if (UNEXPECTED(zend_hash_exists(&ce->function_table, ZSTR_KNOWN(ZEND_STR_WAKEUP)) && ce->__unserialize == NULL)) { + zend_error(E_DEPRECATED, "The __wakeup() serialization hook has been deprecated." + " Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary)"); + } + /* We currently don't early-bind classes that implement interfaces or use traits */ if (!ce->num_interfaces && !ce->num_traits && !ce->num_hooked_prop_variance_checks #ifdef ZEND_OPCACHE_SHM_REATTACHMENT diff --git a/ext/date/tests/bug62852_var2.phpt b/ext/date/tests/bug62852_var2.phpt index 4749d2a9bb21f..99621b81a17d8 100644 --- a/ext/date/tests/bug62852_var2.phpt +++ b/ext/date/tests/bug62852_var2.phpt @@ -22,6 +22,8 @@ try { var_dump( $foo ); ?> --EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var2.php:%d Stack trace: #0 [internal function]: DateTime->__unserialize(Array) diff --git a/ext/date/tests/bug62852_var3.phpt b/ext/date/tests/bug62852_var3.phpt index 7049efcebd84f..52145fc6b1f12 100644 --- a/ext/date/tests/bug62852_var3.phpt +++ b/ext/date/tests/bug62852_var3.phpt @@ -22,6 +22,8 @@ try { var_dump( $foo ); ?> --EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var3.php:%d Stack trace: #0 [internal function]: DateTime->__unserialize(Array) diff --git a/ext/dom/tests/gh8996.phpt b/ext/dom/tests/gh8996.phpt index 62b7955bacf11..e3a567c2e17aa 100644 --- a/ext/dom/tests/gh8996.phpt +++ b/ext/dom/tests/gh8996.phpt @@ -80,6 +80,9 @@ echo "Serialized:\n-----------\n$serialized\n-----------\nRestored:\n----------- ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d === __sleep and __wakeup === string(144) "O:34:"SerializableDomDocumentSleepWakeup":1:{s:43:"%0SerializableDomDocumentSleepWakeup%0xmlData";s:39:" value diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_class.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_class.phpt index 4d5db44ea91b4..f3100f24f1343 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_class.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_class.phpt @@ -110,6 +110,10 @@ $db = MySQLPDOTest::factory(); $db->exec('DROP TABLE IF EXISTS test_stmt_fetch_class'); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d Creating an object, serializing it and writing it to DB... myclass::singleton(Creating object) diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt index 8aaf65f52d9ea..f55edc36c6445 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt @@ -107,6 +107,10 @@ $db = MySQLPDOTest::factory(); $db->exec('DROP TABLE IF EXISTS test_stmt_fetch_serialize'); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d Creating an object, serializing it and writing it to DB... myclass::singleton(Creating object) diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_fetch_class.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_fetch_class.phpt index f2f6c89ad3897..453345a86ed79 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_fetch_class.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_fetch_class.phpt @@ -110,6 +110,10 @@ $db = MySQLPDOTest::factory(); $db->exec('DROP TABLE IF EXISTS test_stmt_fetchserialize_fetch_class'); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d Creating an object, serializing it and writing it to DB... myclass::singleton(Creating object) diff --git a/ext/phar/tests/phar_metadata_write3.phpt b/ext/phar/tests/phar_metadata_write3.phpt index 304ed65b46e9f..2cd87f3983f1c 100644 --- a/ext/phar/tests/phar_metadata_write3.phpt +++ b/ext/phar/tests/phar_metadata_write3.phpt @@ -58,6 +58,7 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php.copy.php'); ?> --EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d Reading file contents through stream wrapper string(18) "contents of file a" Original metadata diff --git a/ext/phar/tests/phar_metadata_write4.phpt b/ext/phar/tests/phar_metadata_write4.phpt index ad9f4d47d91c6..347882682f532 100644 --- a/ext/phar/tests/phar_metadata_write4.phpt +++ b/ext/phar/tests/phar_metadata_write4.phpt @@ -68,6 +68,9 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php.copy.php'); ?> --EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d In __destruct 1 string(1) "a" Loading metadata for 'a' without allowed_classes diff --git a/ext/session/tests/bug53141.phpt b/ext/session/tests/bug53141.phpt index 849a358760400..81ce8e3bd0a89 100644 --- a/ext/session/tests/bug53141.phpt +++ b/ext/session/tests/bug53141.phpt @@ -13,10 +13,10 @@ spl_autoload_register(function ($class) { class Foo { - function __sleep() + function __serialize() { new Bar; - return array(); + return []; } } diff --git a/ext/spl/tests/SplObjectStorage/bug70365.phpt b/ext/spl/tests/SplObjectStorage/bug70365.phpt index 55ff58c9e9122..564814646aa30 100644 --- a/ext/spl/tests/SplObjectStorage/bug70365.phpt +++ b/ext/spl/tests/SplObjectStorage/bug70365.phpt @@ -34,6 +34,7 @@ function ptr2str($ptr) } ?> --EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d array(5) { [0]=> int(1) diff --git a/ext/spl/tests/bug70366.phpt b/ext/spl/tests/bug70366.phpt index d3d3317bff370..9277198508138 100644 --- a/ext/spl/tests/bug70366.phpt +++ b/ext/spl/tests/bug70366.phpt @@ -34,6 +34,7 @@ function ptr2str($ptr) } ?> --EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d array(5) { [0]=> int(1) diff --git a/ext/standard/tests/serialize/001.phpt b/ext/standard/tests/serialize/001.phpt index f2ac0340cf078..9e6b50e0d5dd0 100644 --- a/ext/standard/tests/serialize/001.phpt +++ b/ext/standard/tests/serialize/001.phpt @@ -1,5 +1,5 @@ --TEST-- -serialize()/unserialize()/var_dump() +serialize()/unserialize()/var_dump() using __sleep() and __wakeup() --INI-- serialize_precision=100 --FILE-- @@ -78,6 +78,9 @@ $a = unserialize($data); var_dump($a); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d N; b:1; b:0; diff --git a/ext/standard/tests/serialize/005.phpt b/ext/standard/tests/serialize/005.phpt index 333c09525883c..bc285aa8ddae1 100644 --- a/ext/standard/tests/serialize/005.phpt +++ b/ext/standard/tests/serialize/005.phpt @@ -128,6 +128,14 @@ echo "===AutoNA===\n"; var_dump(unserialize('O:22:"autoload_not_available":0:{}')); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d ===O1=== TestOld::__sleep() diff --git a/ext/standard/tests/serialize/__serialize_004.phpt b/ext/standard/tests/serialize/__serialize_004.phpt index 66db8bf5044be..b410a75619c58 100644 --- a/ext/standard/tests/serialize/__serialize_004.phpt +++ b/ext/standard/tests/serialize/__serialize_004.phpt @@ -38,7 +38,8 @@ var_dump($s = serialize($obj)); var_dump(unserialize($s)); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d string(126) "O:6:"Wakeup":1:{s:4:"data";a:1:{i:0;O:11:"Unserialize":1:{i:0;O:6:"Wakeup":1:{s:4:"data";a:1:{i:0;O:11:"Unserialize":0:{}}}}}}" __unserialize() called array(0) { diff --git a/ext/standard/tests/serialize/bug14293.phpt b/ext/standard/tests/serialize/bug14293.phpt index c52ced3d0f3d4..664542255b713 100644 --- a/ext/standard/tests/serialize/bug14293.phpt +++ b/ext/standard/tests/serialize/bug14293.phpt @@ -26,6 +26,7 @@ var_dump($t); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d __sleep called Warning: serialize(): "b" returned as member variable from __sleep() but does not exist in %s on line %d diff --git a/ext/standard/tests/serialize/bug21957.phpt b/ext/standard/tests/serialize/bug21957.phpt index 9d761a6699c96..0b328daa5995f 100644 --- a/ext/standard/tests/serialize/bug21957.phpt +++ b/ext/standard/tests/serialize/bug21957.phpt @@ -28,7 +28,8 @@ echo $s . "\n"; var_dump(unserialize($s)); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d array(2) { ["one"]=> string(3) "ABC" diff --git a/ext/standard/tests/serialize/bug35895.phpt b/ext/standard/tests/serialize/bug35895.phpt index de7ff6d3e1a4f..729a00d725976 100644 --- a/ext/standard/tests/serialize/bug35895.phpt +++ b/ext/standard/tests/serialize/bug35895.phpt @@ -21,4 +21,8 @@ serialize($obj); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Warning: serialize(): "parents" returned as member variable from __sleep() but does not exist in %s on line %d diff --git a/ext/standard/tests/serialize/bug64354_2.phpt b/ext/standard/tests/serialize/bug64354_2.phpt index 675305132157e..8245ea9653f17 100644 --- a/ext/standard/tests/serialize/bug64354_2.phpt +++ b/ext/standard/tests/serialize/bug64354_2.phpt @@ -20,5 +20,6 @@ try { var_dump($e->getMessage()); } ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d string(6) "Failed" diff --git a/ext/standard/tests/serialize/bug64354_3.phpt b/ext/standard/tests/serialize/bug64354_3.phpt index e3832e653bbfb..9bc031f8ecc9e 100644 --- a/ext/standard/tests/serialize/bug64354_3.phpt +++ b/ext/standard/tests/serialize/bug64354_3.phpt @@ -26,5 +26,7 @@ try { } ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d string(6) "Failed" diff --git a/ext/standard/tests/serialize/bug65806.phpt b/ext/standard/tests/serialize/bug65806.phpt index 166b694442b78..1924d366e0d87 100644 --- a/ext/standard/tests/serialize/bug65806.phpt +++ b/ext/standard/tests/serialize/bug65806.phpt @@ -73,7 +73,10 @@ function check(myObjC $obj) { return 'successful'; } ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d SCRIPT START check successful start serialize/unserialize diff --git a/ext/standard/tests/serialize/bug68976.phpt b/ext/standard/tests/serialize/bug68976.phpt index 514bd8b453fda..c0586e0483913 100644 --- a/ext/standard/tests/serialize/bug68976.phpt +++ b/ext/standard/tests/serialize/bug68976.phpt @@ -25,7 +25,8 @@ for($i = 0; $i < 5; $i++) { var_dump($data); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d array(2) { [0]=> object(evilClass)#1 (0) { diff --git a/ext/standard/tests/serialize/bug69210.phpt b/ext/standard/tests/serialize/bug69210.phpt index 41cc8f55f9a5d..619f0fb333ace 100644 --- a/ext/standard/tests/serialize/bug69210.phpt +++ b/ext/standard/tests/serialize/bug69210.phpt @@ -34,7 +34,10 @@ echo $si . "\n"; var_dump(unserialize($ss)); var_dump(unserialize($si)); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d O:10:"testString":1:{s:1:"a";b:1;} O:11:"testInteger":1:{s:1:"a";b:1;} object(testString)#3 (1) { diff --git a/ext/standard/tests/serialize/bug69425.phpt b/ext/standard/tests/serialize/bug69425.phpt index 1bc79c0387c8c..4803c7f2b7f33 100644 --- a/ext/standard/tests/serialize/bug69425.phpt +++ b/ext/standard/tests/serialize/bug69425.phpt @@ -23,6 +23,7 @@ var_dump($data); ?> --EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d int(1) array(2) { [0]=> diff --git a/ext/standard/tests/serialize/bug70172_2.phpt b/ext/standard/tests/serialize/bug70172_2.phpt index 27e77951fe37c..f2184bb03e688 100644 --- a/ext/standard/tests/serialize/bug70172_2.phpt +++ b/ext/standard/tests/serialize/bug70172_2.phpt @@ -48,7 +48,9 @@ function ptr2str($ptr) } ?> --EXPECTF-- -Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: obj implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d array(2) { [0]=> object(obj2)#%d (1) { diff --git a/ext/standard/tests/serialize/bug70513.phpt b/ext/standard/tests/serialize/bug70513.phpt index 9a93a3359b678..d96a9dbb8a7e1 100644 --- a/ext/standard/tests/serialize/bug70513.phpt +++ b/ext/standard/tests/serialize/bug70513.phpt @@ -26,7 +26,8 @@ var_dump($x); var_dump($obj); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d array(1) { [0]=> int(1) diff --git a/ext/standard/tests/serialize/bug71995.phpt b/ext/standard/tests/serialize/bug71995.phpt index 9d51ace750e13..43045aa26d3c6 100644 --- a/ext/standard/tests/serialize/bug71995.phpt +++ b/ext/standard/tests/serialize/bug71995.phpt @@ -18,6 +18,8 @@ var_dump($s); var_dump(unserialize($s)); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Warning: serialize(): "b" is returned from __sleep() multiple times in %s on line %d string(39) "O:1:"A":1:{s:1:"b";O:8:"stdClass":0:{}}" object(A)#%d (1) { diff --git a/ext/standard/tests/serialize/bug72663.phpt b/ext/standard/tests/serialize/bug72663.phpt index ce767973e97f1..43c668d4ca98b 100644 --- a/ext/standard/tests/serialize/bug72663.phpt +++ b/ext/standard/tests/serialize/bug72663.phpt @@ -49,6 +49,10 @@ try { ?> --EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Warning: unserialize(): Error at offset 17 of 24 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/bug72731.phpt b/ext/standard/tests/serialize/bug72731.phpt index 9489928cfb128..13e1c04739b5e 100644 --- a/ext/standard/tests/serialize/bug72731.phpt +++ b/ext/standard/tests/serialize/bug72731.phpt @@ -15,4 +15,5 @@ var_dump(unserialize($poc)); ?> --EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d %s(73588229205) diff --git a/ext/standard/tests/serialize/bug73154.phpt b/ext/standard/tests/serialize/bug73154.phpt index 8d0f188bf7f34..d0142cd20ba90 100644 --- a/ext/standard/tests/serialize/bug73154.phpt +++ b/ext/standard/tests/serialize/bug73154.phpt @@ -12,5 +12,6 @@ class a { $s = 'a:1:{i:0;O:1:"a":1:{s:1:"a";R:2;}}'; var_dump(serialize(unserialize($s))); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d string(22) "a:1:{i:0;O:1:"a":0:{}}" diff --git a/ext/standard/tests/serialize/bug79526.phpt b/ext/standard/tests/serialize/bug79526.phpt index 440c18772d53d..a41d681c7786d 100644 --- a/ext/standard/tests/serialize/bug79526.phpt +++ b/ext/standard/tests/serialize/bug79526.phpt @@ -24,6 +24,10 @@ serialize(new B()); ?> Done --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Warning: serialize(): A::__sleep() should return an array only containing the names of instance-variables to serialize in %s on line %d Warning: serialize(): B::__sleep() should return an array only containing the names of instance-variables to serialize in %s on line %d diff --git a/ext/standard/tests/serialize/bug81163.phpt b/ext/standard/tests/serialize/bug81163.phpt index 855fc1c953ed2..4287c5aa5a560 100644 --- a/ext/standard/tests/serialize/bug81163.phpt +++ b/ext/standard/tests/serialize/bug81163.phpt @@ -18,4 +18,6 @@ class bar extends foo serialize(new bar()); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Warning: serialize(): bar::__sleep() should return an array only containing the names of instance-variables to serialize in %s on line %d diff --git a/ext/standard/tests/serialize/sleep_deref.phpt b/ext/standard/tests/serialize/sleep_deref.phpt index 36777db0a358c..3ffca1246b16f 100644 --- a/ext/standard/tests/serialize/sleep_deref.phpt +++ b/ext/standard/tests/serialize/sleep_deref.phpt @@ -14,5 +14,6 @@ class Test { var_dump(serialize(new Test)); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d string(28) "O:4:"Test":1:{s:1:"x";i:42;}" diff --git a/ext/standard/tests/serialize/sleep_mangled_name_clash.phpt b/ext/standard/tests/serialize/sleep_mangled_name_clash.phpt index eef5949abbe57..b23cd304339fb 100644 --- a/ext/standard/tests/serialize/sleep_mangled_name_clash.phpt +++ b/ext/standard/tests/serialize/sleep_mangled_name_clash.phpt @@ -12,5 +12,7 @@ $s = serialize(new Test); var_dump(str_replace("\0", '\0', $s)); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Warning: serialize(): "priv" is returned from __sleep() multiple times in %s on line %d string(37) "O:4:"Test":1:{s:10:"\0Test\0priv";N;}" diff --git a/ext/standard/tests/serialize/sleep_undefined_declared_properties.phpt b/ext/standard/tests/serialize/sleep_undefined_declared_properties.phpt index 3c7f802e670b6..31e4f4ad2bb82 100644 --- a/ext/standard/tests/serialize/sleep_undefined_declared_properties.phpt +++ b/ext/standard/tests/serialize/sleep_undefined_declared_properties.phpt @@ -21,6 +21,8 @@ var_dump(serialize(new Test)); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Warning: serialize(): "pub" returned as member variable from __sleep() but does not exist in %s on line %d Warning: serialize(): "prot" returned as member variable from __sleep() but does not exist in %s on line %d diff --git a/ext/standard/tests/serialize/sleep_uninitialized_typed_prop.phpt b/ext/standard/tests/serialize/sleep_uninitialized_typed_prop.phpt index ebef92ca188ae..0b1671a34a9c8 100644 --- a/ext/standard/tests/serialize/sleep_uninitialized_typed_prop.phpt +++ b/ext/standard/tests/serialize/sleep_uninitialized_typed_prop.phpt @@ -32,7 +32,8 @@ var_dump(unserialize(serialize($t)) == $t); var_dump($t); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __sleep() serialization hook has been deprecated. Implement __serialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d string(15) "O:4:"Test":0:{}" bool(true) bool(true) diff --git a/ext/standard/tests/strings/bug72663_3.phpt b/ext/standard/tests/strings/bug72663_3.phpt index bcec2b182a1da..fae1c0b842bb7 100644 --- a/ext/standard/tests/strings/bug72663_3.phpt +++ b/ext/standard/tests/strings/bug72663_3.phpt @@ -14,5 +14,7 @@ unserialize($poc); ?> DONE --EXPECTF-- +Deprecated: The __wakeup() serialization hook has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d + Warning: unserialize(): Error at offset 50 of 50 bytes in %s on line %d DONE diff --git a/tests/classes/bug26737.phpt b/tests/classes/bug26737.phpt index ea7ae1ed9a1cc..515600ad8403c 100644 --- a/tests/classes/bug26737.phpt +++ b/tests/classes/bug26737.phpt @@ -18,5 +18,7 @@ $data = serialize($foo); var_dump(str_replace("\0", '\0', $data)); ?> --EXPECTF-- +Deprecated: The __sleep() serialization hook 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";}" diff --git a/tests/classes/private_members_serialization.phpt b/tests/classes/private_members_serialization.phpt index 1b04b6f59c723..eaa84d94a5451 100644 --- a/tests/classes/private_members_serialization.phpt +++ b/tests/classes/private_members_serialization.phpt @@ -19,5 +19,6 @@ class bar extends foo var_dump(str_replace("\0", '\0', serialize(new bar()))); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: The __sleep() serialization hook 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";}"