Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #394 [Php80] Fix str_ends_with() when needle is longer than hayst…
…ack (SpacePossum) This PR was squashed before being merged into the 1.23-dev branch. Discussion ---------- [Php80] Fix str_ends_with() when needle is longer than haystack Little bug, found in PHP-CS-Fixer/PHP-CS-Fixer#6323 https://3v4l.org/oHUKH ```php <?php error_reporting(E_ALL); $needle = '[]'; echo \substr_compare('', $needle, -\strlen($needle)); ``` show issues for ``` Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.17, 7.3.0 - 7.3.4 Warning: substr_compare(): The start position cannot exceed initial string length in /in/oHUKH on line 4 ``` Looking at the test matrix I assume the tests will run latest 7.2 which is not effected, ~so I naively changed it here in this draft to see if my test indeeds fails on the CI (I don't have an easy 7.2.17 or 7.1.0 env. at hand at the moment)~ @ see shivammathur/setup-php#570 Commits ------- 09a94a5 [Php80] Fix str_ends_with() when needle is longer than haystack
- Loading branch information