Time\Duration - #23073
Open
TimWolla wants to merge 3 commits into
Open
Conversation
derickr
reviewed
Aug 5, 2026
arnaud-lb
reviewed
Aug 5, 2026
|
|
||
| php_date_time_duration *original = Z_DATE_TIME_DURATION_P(ZEND_THIS); | ||
| php_date_time_duration *additional = php_date_time_duration_from_obj(duration); | ||
| php_date_time_duration *new = Z_DATE_TIME_DURATION_P(return_value); |
Member
There was a problem hiding this comment.
When either original or additional has recount==1, it may be possible to reuse it?
arnaud-lb
reviewed
Aug 5, 2026
TimWolla
force-pushed
the
time-duration
branch
8 times, most recently
from
August 5, 2026 20:09
ebb8107 to
5f203d8
Compare
TimWolla
force-pushed
the
time-duration
branch
2 times, most recently
from
August 5, 2026 20:43
89e45ab to
6390166
Compare
TimWolla
commented
Aug 5, 2026
TimWolla
commented
Aug 5, 2026
TimWolla
commented
Aug 5, 2026
TimWolla
force-pushed
the
time-duration
branch
3 times, most recently
from
August 6, 2026 07:45
1f0ff1f to
9e932e2
Compare
TimWolla
force-pushed
the
time-duration
branch
2 times, most recently
from
August 6, 2026 08:23
95eee76 to
a2a58e7
Compare
nyamsprod
reviewed
Aug 6, 2026
derickr
reviewed
Aug 6, 2026
…om*()`
This is useful for patterns like the following:
for (;;) {
$watchers = $poll->wait(Time\Duration::fromSeconds(1));
// …
}
which is repeatedly creating identical duration objects for every loop
iteration.
arnaud-lb
approved these changes
Aug 6, 2026
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
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.
RFC: https://wiki.php.net/rfc/duration_class