Skip to content

Resolve substr based on configured PHP version - #4061

Merged
ondrejmirtes merged 2 commits into
phpstan:2.1.xfrom
VincentLanglet:substr
Jul 17, 2025
Merged

Resolve substr based on configured PHP version#4061
ondrejmirtes merged 2 commits into
phpstan:2.1.xfrom
VincentLanglet:substr

Conversation

@VincentLanglet

@VincentLanglet VincentLanglet commented Jun 13, 2025

Copy link
Copy Markdown
Contributor

Comment thread tests/PHPStan/Analyser/NodeScopeResolverPhp7Test.php Outdated
@VincentLanglet
VincentLanglet marked this pull request as ready for review June 13, 2025 07:05
@phpstan-bot

Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

Comment thread tests/PHPStan/Analyser/data/bug-13129-php7.php
@staabm

staabm commented Jun 13, 2025

Copy link
Copy Markdown
Contributor

btw: since phpunit got upgraded on the PHPStan 2.x branch, we need to be careful to send PRs to PHPStan 1.12.x only when easy mergabe into 2.x (attributes got added etc)

@VincentLanglet

Copy link
Copy Markdown
Contributor Author

btw: since phpunit got upgraded on the PHPStan 2.x branch, we need to be careful to send PRs to PHPStan 1.12.x only when easy mergabe into 2.x (attributes got added etc)

Only change is this attribute
https://github.com/phpstan/phpstan-src/blob/2.1.x/tests/PHPStan/Analyser/LooseConstComparisonPhp7Test.php#L24

I dunno if it will even create a conflict but if ondrej ask, I can target 2.1.x instead :)

@ondrejmirtes

Copy link
Copy Markdown
Member

I'd prefer this one only for 2.1.x :) Thanks.

@VincentLanglet
VincentLanglet changed the base branch from 1.12.x to 2.1.x July 17, 2025 12:46
@VincentLanglet

Copy link
Copy Markdown
Contributor Author

Rebased on 2.1.x @ondrejmirtes

Comment thread tests/PHPStan/Analyser/NodeScopeResolverPhp7Test.php Outdated
@ondrejmirtes
ondrejmirtes merged commit 6881423 into phpstan:2.1.x Jul 17, 2025
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

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.

Return type of substr with constants depends on runtime PHP version instead of analyzed PHP version

4 participants