[php-src] PHP-8.4: Fix GH-22567 (Windows ZTS CLI SAPI should refresh its TSRMLS cache during request activation)

From: Date: Sat, 19 Sep 2026 16:01:23 +0000
Subject: [php-src] PHP-8.4: Fix GH-22567 (Windows ZTS CLI SAPI should refresh its TSRMLS cache during request activation)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-141280@lists.php.net to get a copy of this message
Author: tianfenghan (matyhtf) Committer: Gina Peter Banyard (Girgias) Date: 2026-09-19T16:57:01+01:00 Commit: https://github.com/php/php-src/commit/4e64a2655e9444afaf12970c41d45fbbc9abb2c7 Raw diff: https://github.com/php/php-src/commit/4e64a2655e9444afaf12970c41d45fbbc9abb2c7.diff Fix GH-22567 (Windows ZTS CLI SAPI should refresh its TSRMLS cache during request activation) Closes GH-22568 Changed paths: M NEWS M sapi/cli/php_cli.c Diff: diff --git a/NEWS b/NEWS index 46824ac7d6ae..0382330fa8c1 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.4.27 +- CLI + . Fix GH-22567 (Windows ZTS CLI SAPI should refresh its TSRMLS cache during + request activation). (matyhtf) + - DOM: . Fixed use-after-free when re-constructing a DOMXPath whose php:function registrations are freed while still reachable from the cycle collector. diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 4b19cf0604c6..6894f57c12c0 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -356,6 +356,15 @@ static void sapi_cli_log_message(const char *message, int syslog_type_int) /* {{ } /* }}} */ +static int sapi_cli_activate(void) /* {{{ */ +{ +#if defined(PHP_WIN32) && defined(ZTS) + ZEND_TSRMLS_CACHE_UPDATE(); +#endif + return SUCCESS; +} +/* }}} */ + static int sapi_cli_deactivate(void) /* {{{ */ { fflush(stdout); @@ -420,7 +429,7 @@ static sapi_module_struct cli_sapi_module = { php_cli_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ - NULL, /* activate */ + sapi_cli_activate, /* activate */ sapi_cli_deactivate, /* deactivate */ sapi_cli_ub_write, /* unbuffered write */

« previous php.cvs (#141280) next »