Skip to content
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

[PHP 8.0] Document returning a non-array from __sleep() warning. #1134

Merged

Conversation

mumumu
Copy link
Member

@mumumu mumumu commented Nov 23, 2021

https://3v4l.org/m1pdW#v8.1rc3

Based on 8.1.0 migration guide, added warning note about __sleep magic method.

https://3v4l.org/m1pdW#v8.1rc3

Based on 8.1.0 migration guide, added warning note about __sleep magic method.
@mumumu mumumu added this to the PHP 8.1 milestone Nov 23, 2021
Copy link
Contributor

@salathe salathe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The __sleep() section would benefit from a more general clean up with regards to (diagnostic) error levels and changes for PHP 8.

@@ -96,6 +96,11 @@
Use <link linkend="object.serialize">__serialize()</link> instead.
</para>
</note>
<note>
<para>
As of PHP 8.1.0, returning a value which is not an array from <link linkend="object.sleep">__sleep()</link> generates a diagnostic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like earlier versions also generated "a diagnostic" (assuming this means "a diagnostic error", e.g. E_NOTICE, E_WARNING, and friends). I don't see any user-facing change that happened for 8.1.0 (but the level did change from E_NOTICE to E_WARNING in 8.0.0) for this situation.

language/oop5/magic.xml Outdated Show resolved Hide resolved
@kocsismate kocsismate changed the title [PHP 8.1] Document returning a non-array from __sleep() warning. [PHP 8.0] Document returning a non-array from __sleep() warning. May 13, 2022
@saundefined saundefined modified the milestones: PHP 8.1, PHP 8.0 May 17, 2022
@salathe salathe merged commit 0eda461 into php:master Aug 2, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants