Skip to content

ceil() never returns int#373

Merged
ondrejmirtes merged 1 commit intophpstan:masterfrom
jlherren:fix-ceil-return-type
Nov 13, 2020
Merged

ceil() never returns int#373
ondrejmirtes merged 1 commit intophpstan:masterfrom
jlherren:fix-ceil-return-type

Conversation

@jlherren
Copy link
Copy Markdown
Contributor

However, note that prior to PHP 8 floor() and ceil() returned false when given something other than float|int. Is it worth creating a return type extension for this?

@jlherren
Copy link
Copy Markdown
Contributor Author

Related: JetBrains/phpstorm-stubs#954

@ondrejmirtes
Copy link
Copy Markdown
Member

I don't think so, I generally avoid adding false for invalid inputs - because it's reported from level 5 and up anyway :)

@ondrejmirtes ondrejmirtes merged commit 128492d into phpstan:master Nov 13, 2020
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

@jlherren jlherren deleted the fix-ceil-return-type branch November 29, 2020 09:35
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.

2 participants