Fix twig_compare float-string trailing whitespace + refactor#3256
Merged
Conversation
Contributor
|
Can you revert the Factorize commit? |
Contributor
Author
|
@fabpot: Done. |
yorickgirard
approved these changes
Mar 28, 2020
fabpot
reviewed
May 11, 2020
|
|
||
| [0, 42.0, ' 42.0'], | ||
| [0, 42.0, '42.0 '], | ||
| [-1, 42.0, '42.0abc'], |
Contributor
Author
There was a problem hiding this comment.
@fabpot: But that's unrelated to this PR. Indeed, php/php-src#3886 hasn't been merged (yet), so several existing tests currently return a different result (https://3v4l.org/dX6Q9/rfc#output).
Contributor
|
Thank you @guilliamxavier. |
stof
reviewed
Jun 10, 2020
| if (is_nan($b)) { | ||
| return 1; | ||
| } | ||
| $a = trim($a); |
Member
There was a problem hiding this comment.
wouldn't this trimming cause issue when entering this !is_numeric($a) and comparing strings ? Shouldn't we compare the original string then ?
Contributor
Author
There was a problem hiding this comment.
@stof: I think you are right and there was already the problem for int <=> string above (see https://3v4l.org/RIUI5). Open a new issue/PR?
Contributor
Author
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 #3345
Refs #2966 (and #3186)
(feel free to discard the "Factorize" commit if you favor performance over maintainability)