Numbers/RemovedHexadecimalNumericStrings: prevent some false positives by jrfnl · Pull Request #1366 · PHPCompatibility/PHPCompatibility

@jrfnl jrfnl mentioned this pull request

Oct 26, 2022

1 task

MPParsley

wimg

wimg approved these changes Oct 27, 2022

@jrfnl

Apparently, hexadecimal numeric strings are still supported in a limited number of PHP functions.
While if they are passed in as a variable, we're out of luck, if the text string is hard-coded in the function call, we can prevent a false positive.

This commit adds the logic necessary to prevent these false positives for a limited set of functions currently known to still support hexadecimal numeric strings.

Note: The logic takes function calls using PHP 8.0 named parameters into account.

Includes unit tests.

Fixes 1345

@jrfnl jrfnl deleted the feature/1345-validintegers-prevent-false-positive branch

October 28, 2022 05:52