Bugfix: mbstring polyfills must not raise value errors in PHP 7#501
Open
derrabus wants to merge 1 commit intosymfony:1.xfrom
Open
Bugfix: mbstring polyfills must not raise value errors in PHP 7#501derrabus wants to merge 1 commit intosymfony:1.xfrom
derrabus wants to merge 1 commit intosymfony:1.xfrom
Conversation
9eb2c0b to
847748a
Compare
jdreesen
reviewed
Sep 17, 2024
847748a to
b2da01d
Compare
Closed
| } | ||
|
|
||
| if (!function_exists('mb_str_pad')) { | ||
| function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } |
Member
There was a problem hiding this comment.
what about a bootstrap80.php file to add the return types when running on PHP8+?
Member
Author
There was a problem hiding this comment.
That file already exists. ✌🏻
Member
There was a problem hiding this comment.
ah indeed :)
there are some failures to fix ;)
Member
Author
There was a problem hiding this comment.
Can you help we with those? Apparently, the test listener is skipping tests at a strange point in time which conflicts with the expectWarning() feature of PHPUnit. How do we solve that usually?
b2da01d to
94414f3
Compare
94414f3 to
fca78f8
Compare
Member
|
Let's also address #506 here? |
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.
Fixes #499.
This PR changes all new mbstring polyfills on PHP 7 so that they trigger an oldschool PHP warning instead of raising a
ValueError. The reason for that is that theValueErrorclass might not be available on PHP 7 and the behavior is more consitent with the other polyfills of the mbstring extension.The somewhat weird side-effect is that we now polyfill a behavior that was never implemented in PHP.