Skip to content

Commit bbda4cc

Browse files
Revert "Zend: Deprecate __wakeup() (#19435)"
This reverts commit a5f2eee.
1 parent 8a10141 commit bbda4cc

28 files changed

+5
-101
lines changed

Zend/tests/enum/__wakeup.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ 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-
1816
Fatal error: Enum Foo cannot include magic method __wakeup in %s on line %d

Zend/tests/serialize/bug34045.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@ $db_str = serialize($db);
2424
$db2 = unserialize($db_str);
2525
echo "ok\n";
2626
?>
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
27+
--EXPECT--
2928
ok

Zend/zend_compile.c

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

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

ext/date/tests/bug62852_var2.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ 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-
2725
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var2.php:%d
2826
Stack trace:
2927
#0 [internal function]: DateTime->__unserialize(Array)

ext/date/tests/bug62852_var3.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ 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-
2725
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in %sbug62852_var3.php:%d
2826
Stack trace:
2927
#0 [internal function]: DateTime->__unserialize(Array)

ext/dom/tests/gh8996.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ 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
8684
=== __sleep and __wakeup ===
8785
string(144) "O:34:"SerializableDomDocumentSleepWakeup":1:{s:43:"%0SerializableDomDocumentSleepWakeup%0xmlData";s:39:"<?xml version="1.0"?>
8886
<tag>value</tag>

ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_class.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ $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-
117115
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
118116
Creating an object, serializing it and writing it to DB...
119117
myclass::singleton(Creating object)

ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ $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-
114112
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
115113
Creating an object, serializing it and writing it to DB...
116114
myclass::singleton(Creating object)

ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_fetch_class.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ $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-
117115
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
118116
Creating an object, serializing it and writing it to DB...
119117
myclass::singleton(Creating object)

ext/phar/tests/phar_metadata_write3.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ 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
6261
Reading file contents through stream wrapper
6362
string(18) "contents of file a"
6463
Original metadata

0 commit comments

Comments
 (0)