-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4][com_finder] - php 8.1 serializable-deprecated #36473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as abuse.
This comment was marked as abuse.
|
|
||
| /** | ||
| * Magic method used for serializing. | ||
| */ | ||
| public function __serialize() | ||
| { | ||
| } | ||
|
|
||
| /** | ||
| * Magic method used for unserializing. | ||
| */ | ||
| public function __unserialize($serialized) | ||
| { | ||
| } | ||
|
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PhilETaylor public function __serialize(): array ... shouldn't that be public function __serialize(): string?
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serialize() checks if the class has a function with the magic name __serialize(). If so, that function is executed prior to any serialization. It must construct and return an associative array of key/value pairs that represent the serialized form of the object. If no array is returned a TypeError will be thrown.
Gulp. I am confused.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@PhilETaylor It should be enough if they call the |
This comment was marked as abuse.
This comment was marked as abuse.
|
closing in favour of #36482 |
https://php.watch/versions/8.1/serializable-deprecated
Summary of Changes
added magic method
Testing Instructions
php 8.1
on frontend do a search
check the log
Actual result BEFORE applying this Pull Request
PHP Deprecated: The Serializable interface is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary)Expected result AFTER applying this Pull Request
no more deprecation