Skip to content

Commit 6f3c8f2

Browse files
Revert "Zend: Deprecate __sleep() (#19682)"
This reverts commit f18e992.
1 parent cc80e26 commit 6f3c8f2

37 files changed

+11
-117
lines changed

Zend/tests/enum/__sleep.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 __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
17-
1816
Fatal error: Enum Foo cannot include magic method __sleep in %s on line %d

Zend/tests/lazy_objects/oss_fuzz_71446.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ $obj = $reflector->newLazyProxy(function() {
2020
serialize($obj);
2121
?>
2222
--EXPECTF--
23-
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

Zend/tests/lazy_objects/serialize___sleep.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ try {
3636

3737
?>
3838
--EXPECTF--
39-
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
4039
Init on serialize and successful initialization
4140
string(27) "O:1:"C":1:{s:4:"%0C%0b";i:1;}"
4241
Init on serialize and failed initialization

Zend/tests/lazy_objects/serialize___sleep_initializes.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ $obj = $reflector->newLazyProxy(function ($obj) {
3737
test('Proxy', $obj);
3838

3939
--EXPECTF--
40-
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
4140
# Ghost:
4241
string(11) "initializer"
4342
string(24) "O:1:"C":1:{s:1:"a";i:1;}"

Zend/tests/lazy_objects/serialize___sleep_skip_flag.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ $obj = $reflector->newLazyProxy(function ($obj) {
3535
test('Proxy', $obj);
3636

3737
--EXPECTF--
38-
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
3938
# Ghost:
4039
string(12) "O:1:"C":0:{}"
4140
object(C)#%d (0) {

Zend/tests/lazy_objects/serialize___sleep_skip_flag_may_initialize.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ $obj = $reflector->newLazyProxy(function ($obj) {
3838
test('Proxy', $obj);
3939

4040
--EXPECTF--
41-
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
4241
# Ghost:
4342
string(11) "initializer"
4443
int(1)

Zend/zend_compile.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9355,11 +9355,6 @@ static void zend_compile_class_decl(znode *result, zend_ast *ast, bool toplevel)
93559355
ce->ce_flags |= ZEND_ACC_TOP_LEVEL;
93569356
}
93579357

9358-
if (ce->__serialize == NULL && zend_hash_exists(&ce->function_table, ZSTR_KNOWN(ZEND_STR_SLEEP))) {
9359-
zend_error(E_DEPRECATED, "The __sleep() serialization magic method has been deprecated."
9360-
" Implement __serialize() instead (or in addition, if support for old PHP versions is necessary)");
9361-
}
9362-
93639358
/* We currently don't early-bind classes that implement interfaces or use traits */
93649359
if (!ce->num_interfaces && !ce->num_traits && !ce->num_hooked_prop_variance_checks
93659360
#ifdef ZEND_OPCACHE_SHM_REATTACHMENT

ext/dom/tests/gh8996.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ echo "Serialized:\n-----------\n$serialized\n-----------\nRestored:\n-----------
8080

8181
?>
8282
--EXPECTF--
83-
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
8483
=== __sleep and __wakeup ===
8584
string(144) "O:34:"SerializableDomDocumentSleepWakeup":1:{s:43:"%0SerializableDomDocumentSleepWakeup%0xmlData";s:39:"<?xml version="1.0"?>
8685
<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
@@ -110,8 +110,6 @@ $db = MySQLPDOTest::factory();
110110
$db->exec('DROP TABLE IF EXISTS test_stmt_fetch_class');
111111
?>
112112
--EXPECTF--
113-
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
114-
115113
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
116114
Creating an object, serializing it and writing it to DB...
117115
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
@@ -107,8 +107,6 @@ $db = MySQLPDOTest::factory();
107107
$db->exec('DROP TABLE IF EXISTS test_stmt_fetch_serialize');
108108
?>
109109
--EXPECTF--
110-
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
111-
112110
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
113111
Creating an object, serializing it and writing it to DB...
114112
myclass::singleton(Creating object)

0 commit comments

Comments
 (0)