From 8e4dbf1486ddb81b00a446ac040ff009abe02032 Mon Sep 17 00:00:00 2001 From: Appla Date: 2025年9月10日 16:37:55 +0800 Subject: [PATCH] Fix inconsistent behavior for zend_set_timeout_ex/zend_unset_timeout when zend-max-execution-timers is enabled. --- Zend/zend_execute_API.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index fe37b024934df..d4a373616fe92 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1531,7 +1531,9 @@ static void zend_set_timeout_ex(zend_long seconds, bool reset_signals) /* {{{ */ return; } #elif defined(ZEND_MAX_EXECUTION_TIMERS) - zend_max_execution_timer_settime(seconds); + if (seconds> 0) { + zend_max_execution_timer_settime(seconds); + } if (reset_signals) { sigset_t sigset; @@ -1618,7 +1620,9 @@ void zend_unset_timeout(void) /* {{{ */ tq_timer = NULL; } #elif ZEND_MAX_EXECUTION_TIMERS - zend_max_execution_timer_settime(0); + if (EG(timeout_seconds)) { + zend_max_execution_timer_settime(0); + } #elif defined(HAVE_SETITIMER) if (EG(timeout_seconds)) { struct itimerval no_timeout;

AltStyle によって変換されたページ (->オリジナル) /