Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ PHP NEWS
- Core:
. Fixed bug GH-19765 (object_properties_load() bypasses readonly property
checks). (timwolla)
. The __sleep() magic method has been deprecated. (Girgias)
. The __sleep() and __wakeup() magic methods have been deprecated. (Girgias)

- Opcache:
. Fixed bug GH-19669 (assertion failure in zend_jit_trace_type_to_info_ex).
(Arnaud)

- URI:
. Fixed bug GH-19780 (InvalidUrlException should check $errors argument).
Expand Down
6 changes: 3 additions & 3 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ PHP 8.5 UPGRADE NOTES
$_GET or $_SERVER['QUERY_STRING'] to access the information, after verifying
that the usage is safe.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_register_argc_argv_ini_directive
. The __sleep() magic method has been deprecated. The __serialize() magic
method should be used instead, or at the same time if compatibility with
PHP 7 is required.
. The __sleep() and __wakeup() magic methods have been deprecated. The
__serialize() and __unserialize() magic methods should be used instead,
or at the same time if compatibility with PHP 7 is required.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods

- Curl:
Expand Down
2 changes: 2 additions & 0 deletions Zend/tests/enum/__wakeup.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ enum Foo {

?>
--EXPECTF--
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

Fatal error: Enum Foo cannot include magic method __wakeup in %s on line %d
3 changes: 2 additions & 1 deletion Zend/tests/serialize/bug34045.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ $db_str = serialize($db);
$db2 = unserialize($db_str);
echo "ok\n";
?>
--EXPECT--
--EXPECTF--
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
ok
4 changes: 4 additions & 0 deletions Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -9355,6 +9355,10 @@ static void zend_compile_class_decl(znode *result, zend_ast *ast, bool toplevel)
zend_error(E_DEPRECATED, "The __sleep() serialization magic method has been deprecated."
" Implement __serialize() instead (or in addition, if support for old PHP versions is necessary)");
}
if (ce->__unserialize == NULL && zend_hash_exists(&ce->function_table, ZSTR_KNOWN(ZEND_STR_WAKEUP))) {
zend_error(E_DEPRECATED, "The __wakeup() serialization magic method 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
Expand Down
Loading