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

Consider numeric-string types after string concat #3117

Merged
merged 4 commits into from
Jun 3, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Jun 3, 2024

Improving concat types related to phpstan/phpstan#11129

while implementing I realized that the actual root-cause for 11129 is likely related to some loop related types, not the concat typing alone.

I currently have no plans to look into the loop related parts, therefore submitting this typing enhancements alone. this means this PR will not close Bug 11129.

@staabm staabm marked this pull request as ready for review June 3, 2024 10:21
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.


if (
!is_numeric($rightConstantString->getValue())
|| str_contains($rightConstantString->getValue(), '.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather only include int-like strings rather than exclude strings with .. Look at these fuckers: https://3v4l.org/Ia4r0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another great catch. fixed - thanks.

@ondrejmirtes ondrejmirtes merged commit 193756d into phpstan:1.11.x Jun 3, 2024
443 of 445 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the bug11129 branch June 3, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants