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
date_get_last_errors()
, DateTime::getLastErrors()
may return false
#8478
date_get_last_errors()
, DateTime::getLastErrors()
may return false
#8478
Conversation
I guess thats related and thus this can be closed. |
@boesing just educated me on |
Actually I think maybe you should reopen this. The example with my comment there showed that If we try the same thing with |
I found these snippets: https://psalm.dev/r/393ea844d9<?php
function foo(): array
{
$foo = date_get_last_errors();
/** @psalm-trace $foo */
return $foo;
}
|
@AndrolGenhald - Re-opened. Happy to add some tests, but I could do with a little bit of guidance where these should go |
you're missing a change for date_get_last_errors is Callmap_historical it seems |
b3d9225
to
0f1e416
Compare
Thanks @orklah |
Up to PHP 8.2, these functions return false if no previous date operations have been performed. In PHP 8.2, false is returned after a date operation that yields neither warnings nor errors: https://3v4l.org/HBq0q https://3v4l.org/3QsKY Signed-off-by: George Steel <george@net-glue.co.uk>
0f1e416
to
17ca8ef
Compare
Rebased so cs tests pass 🤞 |
Thanks! |
Up to PHP 8.2,
date_get_last_errors()
,DateTime::getLastErrors()
andDateTimeImmutable::getLastErrors()
return false if no previous date operations have been performed. Currently, In PHP 8.2-RC, false is returned after a date operation that yields neither warnings nor errors:https://3v4l.org/HBq0q
https://3v4l.org/3QsKY