Skip to content

Correct return type of date_sun_info() function#2947

Merged
ondrejmirtes merged 1 commit into
phpstan:1.10.xfrom
zonuexe:fix/type-date_sun_info
Mar 4, 2024
Merged

Correct return type of date_sun_info() function#2947
ondrejmirtes merged 1 commit into
phpstan:1.10.xfrom
zonuexe:fix/type-date_sun_info

Conversation

@zonuexe

@zonuexe zonuexe commented Feb 28, 2024

Copy link
Copy Markdown
Contributor

Prior to PHP 8.0, date_sun_info() function could return false. However, this only applies if the function is called with the wrong arguments. Therefore, the PHP manual only described the return value prototype as array.

It seems that the use cases to which benevolent union should be applied in PHPStan are not yet documented, but this function may be one of them.

refs php/doc-en#3207

@ondrejmirtes
ondrejmirtes merged commit b5db9f1 into phpstan:1.10.x Mar 4, 2024
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

@zonuexe
zonuexe deleted the fix/type-date_sun_info branch March 6, 2024 18:54
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