-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate Soft-deprecated DOMDocument and DOMEntity properties #15369
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
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.
Looks reasonable to me, will wait for Niels to confirm.
Niels has let me know that he's in the USA for a week, so let's merge it before beta1 and if there are issues we can always amend the implementation |
Just checking this out quickly on my phone. The code seems right, however note that doing var_dump on a dom document will now emit deprecation warnings for the properties as well. Idk if this is desired and/or consistent with other deprecated properties. |
@nielsdos thanks for checking it even on a phone! I think we should not emit deprecations during |
@kocsismate Adding a Another possibility is to add a module global variable to silence deprecations. Set it to true in the debug object handler, and reset it to false once that handler finishes. Then just check the global in the relevant read handlers. |
@nielsdos My original idea was to disable emitting warnings, similarly how warnings can be converted to exceptions, but since I didn't find an existing solution, I gave up the idea. Besides, my other idea was along the lines of the global-based approach as you mentioned, but I neither liked this, since it required extending global state. However, I guess this is still acceptable, especially that it's a temporary solution for a few years. So if you are also OK, then I'll do the followup soon. |
Global-based approach is fine for me as it's temporary anyway. |
filed #15530 to fix the behavior |
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#formally_deprecate_soft-deprecated_domdocument_and_domentity_properties