summaryrefslogtreecommitdiff
path: root/UPGRADING
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-01-22 17:47:16 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-03-22 10:43:06 +0100
commitd373c11e710b525feb6373629e3d1ebffef2dd5b (patch)
tree754e1cef72cda4507a688dd609b42fa952638cd5 /UPGRADING
parente7e2056d1a993a01c9d57fb2261066855d282d8f (diff)
downloadphp-git-d373c11e710b525feb6373629e3d1ebffef2dd5b.tar.gz
Implement new custom object serialization mechanism
RFC: https://wiki.php.net/rfc/custom_object_serialization
Diffstat (limited to 'UPGRADING')
-rw-r--r--UPGRADING15
1 files changed, 15 insertions, 0 deletions
diff --git a/UPGRADING b/UPGRADING
index fc8fa459ce..3344a73042 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -107,6 +107,7 @@ PHP 7.4 UPGRADE NOTES
This will enforce that $user->id can only be assigned integer and
$user->name can only be assigned strings. For more information see the
RFC: https://wiki.php.net/rfc/typed_properties_v2
+
. Added support for coalesce assign (??=) operator. For example:
$array['key'] ??= computeDefault();
@@ -156,6 +157,20 @@ PHP 7.4 UPGRADE NOTES
. strip_tags() now also accepts an array of allowed tags: Instead of
strip_tags($str, '<a><p>') you can now write strip_tags($str, ['a', 'p']).
+ . A new mechanism for custom object serialization has been added, which
+ uses two new magic methods:
+
+ // Returns array containing all the necessary state of the object.
+ public function __serialize(): array;
+
+ // Restores the object state from the given data array.
+ public function __unserialize(array $data): void;
+
+ The new serialization mechanism supersedes the Serializable interface,
+ which will be deprecated in the future.
+
+ RFC: https://wiki.php.net/rfc/custom_object_serialization
+
========================================
3. Changes in SAPI modules
========================================