You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DateTime::getLastErrors() not returning false when no errors/warnings #9431
I'm not sure if this is a documentation issue or a PHP bug.
The documentation says that the return type of DateTime::getLastErrors() is array|false. array is returned if there are errors and/or warnings, while false is returned if there's no errors nor warnings.
In actuality, false is not returned even when there are no errors/warnings - the array is returned instead, as can be seen in the above example.
Either the documentation needs to be corrected, or if it's correct, the bug needs to be fixed.
Activity
cmb69 commentedon Aug 26, 2022
Reported behavior confirmed: https://3v4l.org/qB6HQ
However: https://3v4l.org/1IJQh
I'm not quite sure whether this is expected behavior, or at least something that we will change in the future. @derickr, thoughts?
Fixed bug GH-9431: DateTime::getLastErrors() not returning false when…
derickr commentedon Aug 29, 2022
Fixed through 932586c for PHP 8.2 and later only.
fix: valid_date does not work in PHP 8.2
fix: valid_date does not work in PHP 8.2
Temp fix PHP 8.2 (php/php-src#9431)
Fix php warning in PHP8.2
Update DateParser.php
W1DJM commentedon Feb 10, 2023
Why was this not ported to the 8.1.x stream also? The bug appears in 8.1.15 also as evidenced by: https://3v4l.org/eU2ra#v8.1.15
Quirinus commentedon Mar 2, 2023
Thanks!