Improve PHP parser compatibility with different server configurations #1869
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
mbstringextension or on the Unicode functionality of PCRE. After this PR, our PHP parser doesn't either.mbstringcalls 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).