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

mktime (and gmmktime) may still return false in PHP 8+ #396

Open
jaydiablo opened this issue Oct 13, 2022 · 0 comments
Open

mktime (and gmmktime) may still return false in PHP 8+ #396

jaydiablo opened this issue Oct 13, 2022 · 0 comments
Assignees

Comments

@jaydiablo
Copy link
Contributor

In #385, mktime was deprecated in this lib, but technically I think mktime will still return false in an unusual situation:

https://github.com/php/php-src/blob/master/ext/date/php_date.c#L1156

Before digging into php-src to see if it would still return false I explored changing the stubs in phpstan (because with the change in #385 in place, I get phpstan errors about using deprecated functions, but if I remove use function Safe\mktime; then I get the possible false return type, which PHPStan catches in other places, like when passed to the date function).

phpstan/phpstan-src#1768

While it does seem to be an unusual situation (I can't make it return false on 3v4l.org https://3v4l.org/SZSk4), it's still technically correct.

We have to pin this lib at 2.3.7 to avoid these phpstan errors, should mktime and gmmktime be "undeprecated"?

@Kharhamel Kharhamel self-assigned this Oct 19, 2022
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

No branches or pull requests

2 participants