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

Non-numeric strings in pow() lead to error #2796

Merged
merged 6 commits into from
Jul 17, 2024
Merged

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Nov 29, 2023

@staabm staabm marked this pull request as ready for review November 29, 2023 21:32
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@staabm staabm force-pushed the fix-exp branch 2 times, most recently from 7b2ac0c to 86acced Compare December 7, 2023 18:42
new NullType(),
]);
if (!$allowedOperandTypes->isSuperTypeOf($exponent)->yes()) {
return new ErrorType();
Copy link
Member

Choose a reason for hiding this comment

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

I disagree with returning ErrorType here.
string might still be a numeric-string so it's wrong to return ErrorType for that case.

We just want to prevent the internal error the issue is about.

@staabm staabm changed the base branch from 1.10.x to 1.11.x July 17, 2024 11:29
@staabm
Copy link
Contributor Author

staabm commented Jul 17, 2024

reduced the PR to a minimal fix

@ondrejmirtes ondrejmirtes merged commit 924f173 into phpstan:1.11.x Jul 17, 2024
449 of 454 checks passed
@ondrejmirtes
Copy link
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.

3 participants