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.1] False error: "Readonly property is assigned outside of the constructor" while in __unserialize #6384

Closed
ruudk opened this issue Jan 17, 2022 · 1 comment · Fixed by phpstan/phpstan-src#929

Comments

@ruudk
Copy link
Contributor

ruudk commented Jan 17, 2022

Bug report

According to the RFC assigning readonly properties should be allowed in __unserialize method.

Code snippet that reproduces the problem

https://phpstan.org/r/baac0f50-da4d-47a7-83d2-95eb8a4ea4ac

PHP 8.1 just allows this, as stated per RFC, https://3v4l.org/53Dug#v8.1.1

Expected output

No error

Did PHPStan help you today? Did it make you happy in any way?

Thank you for making PHPStan better every day! It's amazing.

--

PR to solve it:

@ruudk ruudk changed the title False error: "Readonly property is assigned outside of the constructor" while in __unserialize [PHP 8.1] False error: "Readonly property is assigned outside of the constructor" while in __unserialize Jan 17, 2022
ruudk added a commit to ruudk/phpstan-src that referenced this issue Jan 17, 2022
ondrejmirtes pushed a commit to phpstan/phpstan-src that referenced this issue Jan 17, 2022
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant