Skip to content
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

Fix preg_filter function signature #826

Merged
merged 1 commit into from
Dec 10, 2021
Merged

Fix preg_filter function signature #826

merged 1 commit into from
Dec 10, 2021

Conversation

johnstevenson
Copy link
Contributor

preg_filter has had the same function signature as preg_replace since it was first introduced in PHP 5.3, but this has not been updated in functionMap.php.

This causes a failure on PHP <8.0 as per: https://phpstan.org/r/20453e88-edfc-4e1b-8e1f-728a9a1c7c60

Function signatures

preg_filter: https://github.com/php/php-src/blob/7311087cf06bf9f3d6b5863d9b54272f3d163ba9/ext/pcre/php_pcre.c#L1418-L1419
preg_replace: https://github.com/php/php-src/blob/7311087cf06bf9f3d6b5863d9b54272f3d163ba9/ext/pcre/php_pcre.c#L1402-L1403

`preg_filter` has had the same function signature as `preg_replace` since it was first introduced in PHP 5.3, but this has not been updated in functionMap.php. This causes a failure on PHP <8.0 as per: https://phpstan.org/r/20453e88-edfc-4e1b-8e1f-728a9a1c7c60

preg_filter: https://github.com/php/php-src/blob/7311087cf06bf9f3d6b5863d9b54272f3d163ba9/ext/pcre/php_pcre.c#L1418-L1419
preg_replace: https://github.com/php/php-src/blob/7311087cf06bf9f3d6b5863d9b54272f3d163ba9/ext/pcre/php_pcre.c#L1402-L1403
@ondrejmirtes ondrejmirtes merged commit 38baea6 into phpstan:master Dec 10, 2021
@ondrejmirtes
Copy link
Member

Thank you!

@johnstevenson johnstevenson deleted the patch-1 branch December 10, 2021 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants