Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Feb 1, 2022

public function multiplyZero(int $i, float $f, $range): void
{
assertType('0', $i * 0);
assertType('0', $f * 0);
Copy link
Member

Choose a reason for hiding this comment

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

Float multiplied by zero is a float: https://3v4l.org/u6dA6

It also works for strings: https://3v4l.org/Ksheh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch. fixed

@ondrejmirtes ondrejmirtes merged commit 5087733 into phpstan:master Feb 6, 2022
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the multiplyZero branch February 6, 2022 11: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.

Multiplied by 0 should be 0

3 participants