Skip to content

Commit a5f2eee

Browse files
authored
1 parent 2d545dd commit a5f2eee

28 files changed

+100
-5
lines changed

Zend/tests/enum/__wakeup.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ enum Foo {
1313

1414
?>
1515
--EXPECTF--
16+
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
17+
1618
Fatal error: Enum Foo cannot include magic method __wakeup in %s on line %d

Zend/tests/serialize/bug34045.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ $db_str = serialize($db);
2424
$db2 = unserialize($db_str);
2525
echo "ok\n";
2626
?>
27-
--EXPECT--
27+
--EXPECTF--
28+
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
2829
ok

Zend/zend_compile.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9355,6 +9355,10 @@ static void zend_compile_class_decl(znode *result, zend_ast *ast, bool toplevel)
93559355
zend_error(E_DEPRECATED, "The __sleep() serialization magic method has been deprecated."
93569356
" Implement __serialize() instead (or in addition, if support for old PHP versions is necessary)");
93579357
}
9358+
if (UNEXPECTED(zend_hash_exists(&ce->function_table, ZSTR_KNOWN(ZEND_STR_WAKEUP)) && ce->__unserialize == NULL)) {
9359+
zend_error(E_DEPRECATED, "The __wakeup() serialization magic method has been deprecated."
9360+
" Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary)");
9361+
}
93589362

93599363
/* We currently don't early-bind classes that implement interfaces or use traits */
93609364
if (!ce->num_interfaces && !ce->num_traits && !ce->num_hooked_prop_variance_checks

ext/date/tests/bug62852_var2.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ try {
2222
var_dump( $foo );
2323
?>
2424
--EXPECTF--
25+
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
26+
2527
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var2.php:%d
2628
Stack trace:
2729
#0 [internal function]: DateTime->__unserialize(Array)

ext/date/tests/bug62852_var3.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ try {
2222
var_dump( $foo );
2323
?>
2424
--EXPECTF--
25+
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
26+
2527
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var3.php:%d
2628
Stack trace:
2729
#0 [internal function]: DateTime->__unserialize(Array)

ext/dom/tests/gh8996.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ echo "Serialized:\n-----------\n$serialized\n-----------\nRestored:\n-----------
8181
?>
8282
--EXPECTF--
8383
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
84+
85+
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
8486
=== __sleep and __wakeup ===
8587
string(144) "O:34:"SerializableDomDocumentSleepWakeup":1:{s:43:"%0SerializableDomDocumentSleepWakeup%0xmlData";s:39:"<?xml version="1.0"?>
8688
<tag>value</tag>

ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_class.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ $db->exec('DROP TABLE IF EXISTS test_stmt_fetch_class');
112112
--EXPECTF--
113113
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
114114

115+
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
116+
115117
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
116118
Creating an object, serializing it and writing it to DB...
117119
myclass::singleton(Creating object)

ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ $db->exec('DROP TABLE IF EXISTS test_stmt_fetch_serialize');
109109
--EXPECTF--
110110
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
111111

112+
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
113+
112114
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
113115
Creating an object, serializing it and writing it to DB...
114116
myclass::singleton(Creating object)

ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_fetch_class.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ $db->exec('DROP TABLE IF EXISTS test_stmt_fetchserialize_fetch_class');
112112
--EXPECTF--
113113
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
114114

115+
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
116+
115117
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
116118
Creating an object, serializing it and writing it to DB...
117119
myclass::singleton(Creating object)

ext/phar/tests/phar_metadata_write3.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
5858
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php.copy.php');
5959
?>
6060
--EXPECTF--
61+
Deprecated: The __wakeup() serialization magic method has been deprecated. Implement __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
6162
Reading file contents through stream wrapper
6263
string(18) "contents of file a"
6364
Original metadata

0 commit comments

Comments
 (0)