Skip to content

Add regression tests for resource parameters of internal functions on PHP 7.4 - #6449

Merged
ondrejmirtes merged 1 commit into
2.2.xfrom
regression-tests-15139-15141-15185
Sep 15, 2026
Merged

ondrejmirtes merged 1 commit into
2.2.xfrom
regression-tests-15139-15141-15185

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

On PHP 7.x, PhpStorm stubs describe resource parameters (e.g. curl_getinfo, finfo_buffer) through #[LanguageLevelTypeAware]. BetterReflection turned that into a native type, which PHP reads back as a class named resource, so PHPStan reported "expects resource, resource given". The BetterReflection update to 6.73.0.0 (db01588) moves resource into the PHPDoc instead, which fixed all three issues.

This adds CallToFunctionParametersRulePhp74Test, analysing as PHP 7.4 (phpVersion: 70400), with the playground reproducers from each issue expecting no errors.

Verified: all three tests fail with BetterReflection 6.70.0.6 with the exact messages from the issues, and pass with 6.73.0.1.

Closes phpstan/phpstan#15139
Closes phpstan/phpstan#15141
Closes phpstan/phpstan#15185

🤖 Generated with Claude Code

https://claude.ai/code/session_01PD8LHLdzVCovrqsR7rSsRU

@ondrejmirtes
ondrejmirtes merged commit 7546cd6 into 2.2.x Sep 15, 2026
236 of 237 checks passed
@ondrejmirtes
ondrejmirtes deleted the regression-tests-15139-15141-15185 branch September 15, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant