Open ChristophWurst opened 1 year ago
I found these snippets:
Callmaps are overriden in stubs in this case: https://github.com/vimeo/psalm/blob/8d36bdc3edaee176ecc25b7e145b9e56fb81d7ea/stubs/CoreImmutableClasses.phpstub#L26
@Ocramius is this an error or was this intended?
Not sure/can't remember.
I think I read in php-src about these specific implementation details: would endorse looking at git blame
to determine whether it was intentional.
Looking at the history, I think the restricted return type is a mistakes, while my intent was to mark the API as pure.
I would suggest checking php-src to verify if that method ever returns false
, and no, the PHP documentation is not reliable 😛
I've looked into this before. It depends on an internal flag that I didn't understand:
if (dateobj->time->is_localtime) {
} else {
RETURN_FALSE;
}
We ended up ignoring this possibility.
https://psalm.dev/r/590531597a
This is very similar to https://github.com/vimeo/psalm/issues/4515. Apparently this still happens, but only for immutable datetime objects.
https://www.php.net/manual/en/datetime.gettimezone.php