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

Entirely possible for time() to return zero/-ve integer #922

Closed
wants to merge 1 commit into from

Conversation

cs278
Copy link
Contributor

@cs278 cs278 commented Jan 13, 2022

time() might not be a positive integer, if you're having a bad day…

$ faketime '1970-01-01 00:00:00Z' php -r 'echo time(),"\n";'
0
$ faketime -f -100y php -r 'echo time(),"\n";'
-1511501206

#760

@ondrejmirtes
Copy link
Member

Hi, unless you set your system date to a really old date, this really isn't possible :) And at that point nothing really works for you, things like HTTPS certificates etc...

@cs278
Copy link
Contributor Author

cs278 commented Jan 13, 2022

Most people are highly unlikely to run in to this regardless of the definition. But I must admit I expect whats in the functionMap.php to match what is possible however small the probability. Anyway feel free to close if you aren't swayed, I just spotted it and thought it was odd.

@cs278 cs278 deleted the time-can-be-negative branch January 14, 2022 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants