-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Improve PHP parser compatibility with different server configurations #1869
Merged
Conversation
This file contains 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
This is a per-iteration limit rather than a total limit, so there's no need to increase it from the value used in the rest of WP core.
nylen
force-pushed
the
remove/php-parser-mbstring-calls
branch
from
July 12, 2017 14:57
ffb2a1f
to
d40deff
Compare
mdawaffe
approved these changes
Jul 12, 2017
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.
LGTM. Tests pass :)
lib/compat.php
Outdated
if ( count( $pieces ) > 1 ) { | ||
$str = array_pop( $pieces ); | ||
} else { | ||
$str = null; |
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.
It might be clearer to just break
here, but I bow to your judgement.
nylen
added a commit
that referenced
this pull request
Jul 13, 2017
2 tasks
Tug
pushed a commit
that referenced
this pull request
Feb 28, 2020
…e-aztec-example-project Delete react-native-aztec's example project
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.
Fixes #1611.
The rest of WordPress does not depend on the presence of the
mbstring
extension or on the Unicode functionality of PCRE. After this PR, our PHP parser doesn't either.mbstring
calls via nylen/phpegjs@ab1dc14.As compared to #1775, the first set of changes here yields a slight performance improvement:
Under normal circumstances, the second set of changes will have no performance impact. Forcing the code to use the alternative (non-PCRE-Unicode) method of splitting a string slows PHP 5.6 down by about 5ms, and does not appear to affect PHP 7 performance significantly.
For more details on the specific approaches taken here, see #1611 (comment).