Skip to content
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

Minimal ZonedDateTime #33

Open
repli2dev opened this issue Mar 10, 2021 · 5 comments
Open

Minimal ZonedDateTime #33

repli2dev opened this issue Mar 10, 2021 · 5 comments

Comments

@repli2dev
Copy link

var_dump(LocalDateTime::min()->getYear());
var_dump($a= ZonedDateTime::of(LocalDateTime::min(), TimeZone::utc())->getYear());

will yield

-999999
9999

Which is quite unexpected.

@repli2dev
Copy link
Author

Moreover same problem with max()

var_dump(LocalDateTime::max()->getYear());
var_dump($a= ZonedDateTime::of(LocalDateTime::max(), TimeZone::utc())->getYear());

@BenMorel
Copy link
Member

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)

@repli2dev
Copy link
Author

@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...

@BenMorel
Copy link
Member

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.

@repli2dev
Copy link
Author

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants