-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Refactor basic time usages #19202
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
Open
Open
Refactor basic time usages #19202
+560
−841
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@github-actions
github-actions
bot
added
Category: Build System
SAPI: fpm
Extension: openssl
Extension: date
Extension: ftp
Extension: mysqlnd
Extension: opcache
Extension: session
Extension: soap
Extension: standard
SAPI: cgi
SAPI: cli
SAPI: phpdbg
Category: Optimizer
Extension: random
ABI break
labels
Jul 21, 2025
@marc-mabe
marc-mabe
force-pushed
the
current_time_wrapper
branch
14 times, most recently
from
July 23, 2025 13:19
c81c27f
to
8c044c8
Compare
@marc-mabe
marc-mabe
force-pushed
the
current_time_wrapper
branch
2 times, most recently
from
July 25, 2025 07:37
db6170e
to
88052ab
Compare
@marc-mabe
marc-mabe
requested review from
kocsismate,
dstogov,
bukka,
nielsdos,
Girgias,
TimWolla,
zeriyoshi,
kamil-tekiela,
SakiTakamachi and
derickr
as code owners
July 25, 2025 08:12
@marc-mabe
marc-mabe
force-pushed
the
current_time_wrapper
branch
2 times, most recently
from
July 26, 2025 08:46
7e3d98c
to
fdabd9b
Compare
@marc-mabe
marc-mabe
force-pushed
the
current_time_wrapper
branch
from
July 28, 2025 07:02
1058493
to
9429859
Compare
@marc-mabe
marc-mabe
force-pushed
the
current_time_wrapper
branch
from
September 21, 2025 05:50
9429859
to
3aa094c
Compare
@marc-mabe
marc-mabe
force-pushed
the
current_time_wrapper
branch
from
October 4, 2025 19:57
315f346
to
956b7a0
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
This refactors the internal usages of the current time.
zend_time.h
to be used instead of systemtime.h
zend_realtime_spec
as a wrapper aroundclock_gettime
,timespec_get
,gettimeofday
andtime
using the real/wall clock providing atimespec
with up to nanosecond resolutionzend_realtime_get
as a macro wrapper fortime(NULL)
zend_monotime_fallback
either pointing tozend_hrtime
or wrappingzend_realtime_spec
timeval
andtimespec
zend_realtime_*
/zend_monotime_fallback
timespec
for current time but keeptimeval
as it's needed for file/streamsAs a result:
zend_realtime_get
/zend_realtime_spec
andzend_monotime_fallback
will be available for sure because it falls backclock_gettime
->timespec_get
->gettimeofday
->time
long
oftimeval.tv_sec
should be fixed time() and friends have Y2038 problem on 64 Windows #17856microtime()
/gettimeofday(true)
without BC breakEven thought
gettimeofday
may not be available it wasn't checked everywhere before and compiling would have been failed already if missing. Availability should now be checked but as it falls back and it must have been available before I removed the conditions aroundmicrotime
,gettimeofday
anduniqid