DateTimeImmutable::modify() can no longer return false since PHP 8.3
Since PHP 8.3, DateTimeImmutable::modify() can no longer return false, and throws DateMalformedStringException instead.
Relevant RFC: https://wiki.php.net/rfc/datetime-exceptions
Relevant php-src commit: https://github.com/php/php-src/commit/b7860cd56476d737fcf2e1fdda109b042312e3fa
Relevant code change:
Some tests failed, otherwise 👍
Btw what about @throws for the method?
Btw what about @throws for the method?
It throws DateMalformedStringException. But you can't put @throws into function map, can you?
There would have to be conditionally loaded stub file for 8.4+.
Can we fix @throws in next step? I believe this already improves things.
I feel like fixing the return type and adding @throws is an atomic change. We know it should be done, let's do it while we have the context.
Looks to be fixed as part of https://github.com/phpstan/phpstan-src/pull/3209.
I totally forgot about this PR, sorry! I was forced to fix this as part of update to jetbrains/phpstorm-stubs about exception-throwing on 8.3.