-
Notifications
You must be signed in to change notification settings - Fork 665
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
Invalid inferred return type of DateTimeImmutable::getTimestamp
#7855
Comments
I found these snippets: https://psalm.dev/r/c45a9a0a0f<?php
function getArr(): array
{
$date = new DateTimeImmutable('2022-04-11 09:45');
$arr = [$date->getTimestamp() => []];
return $arr;
}
|
According to the docs this is a PHP 8 update to throw Might as well fix the other methods on |
ah, yeah that explains it, I'm on php 8.1, only looked into IDE docs (for php8.1 stubs docs). Thanks for clearing this up and thanks for looking into it :) |
…er versions there is a ValueError returned instead
…er versions there is a ValueError returned instead
Resolve #7855 remove false from return type, in php8.0 and further ve…
this was fixed :) |
Hello I've come across an issue while constructing an array with timestamps used as keys, psalm is reporting
false|int
can't be used as array key whilegetTimestamp
always returns anint
.e.g. https://psalm.dev/r/c45a9a0a0f
The text was updated successfully, but these errors were encountered: