Allow to call XMLReader::open() and ::XML() statically#4816
Closed
cmb69 wants to merge 1 commit into
Closed
Conversation
The implementation of `XMLReader::open()` and `XMLReader::XML()` still supports calling the methods statically and non-statically. However, as of PHP 8.0.0, calling these methods statically is not allowed, because they are not declared as static methods. Since we consider it to be cleaner to call these methods statically, but had deprecated to call them statically, we properly support both variants.
Member
|
I would say this change makes more sense in 7.4 but how late we are in the initial QA period it feels a bit odd. Probably need to ask @derickr what he thinks about it. |
Member
|
No more changes in 7.4! :-) |
Member
Author
|
Okay, so we should do this for master only. If there are no objections, I'll merge this in a week. |
nikic
approved these changes
Oct 29, 2019
Member
Author
|
Thanks! Applied as 6468578. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The implementation of
XMLReader::open()andXMLReader::XML()stillsupports calling the methods statically and non-statically. However,
as of PHP 8.0.0, calling these methods statically is not allowed,
because they are not declared as static methods. Since we consider it
to be cleaner to call these methods statically, but had deprecated to
call them statically, we properly support both variants.
This PR supersedes PR #4680.
After further consideration, I still think it would be good to rid the option to call these methods non-statically, and to also remove
XMLReader::close()in the long run, prepared by a deprecation phase. However, as of PHP 7.0.0 calling these methods triggered a deprecation notice, so likely quite some code has already been adjusted to that, so deprecating the non-static calls right away (PHP 8.0.0) would be very annoying for users.Anyhow, if we stick with the dual calling mechanism for a while (or even forever), we probably should refactor to use
zend_parse_method_parameters().PS: it might be useful to do this change already for PHP 7.4.