diff --git a/NEWS b/NEWS index 35342af36fb..d76fb3e1a07 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ PHP NEWS - Core: . Fixed bug GH-19765 (object_properties_load() bypasses readonly property checks). (timwolla) + . Fixed hard_timeout with --enable-zend-max-execution-timers. (Appla) - Opcache: . Fixed bug GH-19669 (assertion failure in zend_jit_trace_type_to_info_ex). diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 48e61c68390..6f790df8698 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1570,7 +1570,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; @@ -1657,7 +1659,9 @@ void zend_unset_timeout(void) /* {{{ */ tq_timer = NULL; } #elif defined(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;