Fixed bug GH-20745 ("Casting out of range floats to int" applies to strings) #20746
+4
−34
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.
This reverts the warning for float-strings, to whose it never should have been applied in the first place.
@Girgias We did not vote on that. The PR was done after the RFC, and never up for consideration at vote time.
In fact, during discussion time, it was even the topic: https://news-web.php.net/php.internals/128293 - but it was clarified (by someone else) that it's only about floats, not float-strings.
Feel free to propose it again for PHP 8.6 - I personally think it only should apply to implicit casts, in line with https://wiki.php.net/rfc/implicit-float-int-deprecate.
But for PHP 8.5 we should revert this ad-hoc addition to the first PHP 8.5 RC.
From my point of view this is a regression, where nobody agreed on break compatibility here.
With respect to the PR, I retain the zend_oob_string_to_long_error function, as removing it would probably break ABI, but removing all callers should be sufficient.