-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add support for PHP 8.4 Lazy Objects RFC with configuration flag #11853
base: 3.4.x
Are you sure you want to change the base?
Conversation
… expensive and could lead to errors. Adjust lifecycle test that uses transient properittes for assertions.
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.
Well done!
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.
Well done, so happy it works this seamlessly :)
I agree with @GromNaN : the term proxy is now inaccurate; this uses the ghost strategy, no proxy is involved.
…t required anymore with native lazy objects.
@jaapio the docs build suddenly fails, what should we do? |
You need to update phpDocumentor/filesystem. As this is an unexpected breaking change. But it's fixed when you update the package. |
I made doctrine/.github#60 from my phone 📱 |
Our goal is that we can completely replace all kinds of code for proxy generation and proxy usage with the new lazy objects feature of PHP 8.4: https://wiki.php.net/rfc/lazy-objects
In 3.4.x we can add support for optionally using lazy objects, and in 4.x we increase the requirement for PHP to 8.4 and automatically always use lazy objects.
The benefit of lazy objects is that we don't need code-generation anymore, and that it also allows us to treat partial objects as lazy objects that can load their missing properties only when accessed.
See #11659 for prerequisites of using new Reflection APIs.
Use:
To run tests with this
ENABLE_NATIVE_LAZY_OBJECTS=1 php vendor/bin/phpunit
.