We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ab2e15 commit 976ae98Copy full SHA for 976ae98
async.c
@@ -572,10 +572,14 @@ PHP_FUNCTION(Async_delay)
572
return;
573
}
574
575
- zend_async_waker_new_with_timeout(coroutine, ms, NULL);
+ if (UNEXPECTED(ms == 0)) {
576
+ ZEND_ASYNC_ENQUEUE_COROUTINE(ZEND_ASYNC_CURRENT_COROUTINE);
577
+ } else {
578
+ zend_async_waker_new_with_timeout(coroutine, ms, NULL);
579
- if (UNEXPECTED(EG(exception) != NULL)) {
- RETURN_THROWS();
580
+ if (UNEXPECTED(EG(exception) != NULL)) {
581
+ RETURN_THROWS();
582
+ }
583
584
585
ZEND_ASYNC_SUSPEND();
0 commit comments