Skip to content

Commit a559a5e

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix max_execution_time with cli-server router script
2 parents f6268b8 + 299c3ba commit a559a5e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.3.2
44

5+
- Cli:
6+
. Fix incorrect timeout in built-in web server when using router script and
7+
max_input_time. (ilutov)
8+
59
- Core:
610
. Fixed bug GH-12854 (8.3 - as final trait-used method does not correctly
711
report visibility in Reflection). (nielsdos)

sapi/cli/php_cli_server.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,6 +2249,17 @@ static bool php_cli_server_dispatch_router(php_cli_server *server, php_cli_serve
22492249
zend_try {
22502250
zval retval;
22512251

2252+
/* Normally php_execute_script restarts the timer with max_execution_time if it has
2253+
* previously been initialized with max_input_time. We're not using php_execute_script here
2254+
* because it does not provide a way to get the return value of the main script, so we need
2255+
* to restart the timer manually. */
2256+
if (PG(max_input_time) != -1) {
2257+
#ifdef PHP_WIN32
2258+
zend_unset_timeout();
2259+
#endif
2260+
zend_set_timeout(INI_INT("max_execution_time"), 0);
2261+
}
2262+
22522263
ZVAL_UNDEF(&retval);
22532264
if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE, &retval, 1, &zfd)) {
22542265
if (Z_TYPE(retval) != IS_UNDEF) {

0 commit comments

Comments
 (0)