-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Memory leak when class and trait declare same static property with doc block in 8.3 #12207
Comments
I think the suggested fix is almost right, except that I believe doc_comment may also be persistent. So please use zend_string_release instead of zend_string_release_ex. |
quick question, would we need to do the same here ? |
That code is only for internal classes. I don't know if we actively support doc comments for internal classes (e.g. via stub generation). Probably, for completeness we should do the same fix there too as it's possible to call the API manually anyway. For that case, you may use |
Thanks for the input! I found this Line 388 in 3e0e7e3
Thats why I used it in my patch as well. But I will create a PR with |
Description
When building the current PHP-8.3 branch (tested with commit 99cd81c) in debug mode, PHP reports a memory leak when executing the following code:
Resulted in this output:
The doc block from the class is leaked. I had the same behavior with the 8.3 beta 3. The issue did not occur in 8.2 for me.
The following change fixes the issue for me:
But I don't think thats a proper fix for the issue.
PHP Version
PHP 8.3
Operating System
Mac OS X
The text was updated successfully, but these errors were encountered: