-
Couldn't load subscription status.
- Fork 8k
Bug 67719 #753
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
Bug 67719 #753
Conversation
|
The skip code can be put much lower inside the code, just before when the trailing length check is performed; like this. |
|
I don't understand how your code excludes trailing chars |
|
Just before the trailing length check is done, |
|
Am I missing something here? |
|
@sameg14 Yes, it's not about the case of leading whitespace but treating trailing whitespace in the same way. |
|
Aah ok I get it now, definitely agree this should get fixed! |
|
Wouldn't it make more sense to run php_trim() internally on this to strip both leading and exceeding whitespace in one go here? Agreed that it should be fixed tho |
|
@KalleZ As this code is performance-critical, using php_trim() here is not appropriate. I'm tentatively in favor of this change, but I think that it requires an RFC (or at the least an internals discussion). The impact here is larger than just is_numeric(), this change affects many (implicit) type conversions in the language. |
|
@nikic, I haven't created an RFC before, but if you (or someone else) can guide me, I can try to create it :) |
|
Having waited 6 months for this 3 year old PR to get moving, I'm quite confident that this is going nowhere, so I'm closing the PR. Please take this action as encouragement to move forward with a clean PR and RFC. |
Make is_numeric() consistent. Since " 1" == 1 and "1 " == 1, is_numeric() should return true for both strings.