[IoPoll] Take Time\Duration in Context::wait() - #645
Merged
Conversation
Member
do they differ intentionally or because php-src updated them after we vendored them ? In the later case, maybe we should sync them. |
Contributor
|
Member
Author
|
php/php-src#23099 settles the argument number question: the negative timeout is reported as argument #1, which is what this polyfill already did, so there is nothing to align. Its new |
nicolas-grekas
force-pushed
the
io-poll-duration
branch
from
August 7, 2026 13:09
ee57d4f to
ad4070b
Compare
nicolas-grekas
force-pushed
the
io-poll-duration
branch
from
August 7, 2026 13:10
ad4070b to
5d1b0f3
Compare
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.
Depends on #642, on top of which this branch sits — only the last commit belongs here.
php/php-src#23092 is merged and ships in 8.6 Beta 1, alongside
Time\Duration. It replaces the$timeoutSeconds/$timeoutMicrosecondsarguments ofIo\Poll\Context::wait()by a single?Time\Duration $timeout:The vendored phpt files get exactly the edits php-src made in that commit:
wait(0)becomeswait(Time\Duration::fromSeconds(0))andwait(0, 100000)becomeswait(Time\Duration::fromMicroseconds(100000)). Every file that was a byte-identical copy ofext/standard/tests/poll/still is; the three that already differed (poll.inc,poll_stream_sock_rw_close.phpt,poll_stream_sock_rw_multi_level.phpt, all stale rather than adapted) keep exactly the differences they had.symfony/polyfill-timeis deliberately not a dependency: the polyfill never builds aDuration, it only reads->negative,->secondsand->nanosecondsoff the instance it is handed, and the type declaration is only resolved when a non-null value is passed. Callingwait()orwait(null)therefore works without it, and a caller that has aDurationto pass necessarily has the class already. The component README says where to get it.One divergence worth a decision: native reports the negative-timeout error as argument #2,
which looks like a leftover from the old signature, since
$timeoutis argument #1 and #2 is now$maxEvents. No phpt covers it. The polyfill reports #1; if upstream keeps #2 I will align.