Open repli2dev opened 3 years ago
Moreover same problem with max()
var_dump(LocalDateTime::max()->getYear());
var_dump($a= ZonedDateTime::of(LocalDateTime::max(), TimeZone::utc())->getYear());
Hi, I can only reproduce the problem with max()
:
var_dump(LocalDateTime::min()->getYear());
var_dump(ZonedDateTime::of(LocalDateTime::min(), TimeZone::utc())->getYear());
var_dump(LocalDateTime::max()->getYear());
var_dump(ZonedDateTime::of(LocalDateTime::max(), TimeZone::utc())->getYear());
int(-999999)
int(-999999)
int(999999)
int(1999)
@BenMorel Speaking of the min()
... There seem to be a difference in used PHP version:
PHP 8.0 is OK,
PHP 7.4 is NOK,
PHP 7.2 is NOK...
I don't think it has to do with the PHP version, I get int(-999999)
on PHP 7.3 and 7.4, too.
Thank you for the report anyway, I will look into it.
@BenMorel even more weird, just by switching PHP versions it got me the weird output. (PHP 8 and PHP 7.4 and PHP 7.2 installed via brew)... Also I have tested PHP 7.3 from MacOS and it is also NOK.
Could any extension cause this?
will yield
Which is quite unexpected.