[php-src] PHP-8.6: Merge branch 'PHP-8.5' into PHP-8.6

From: Date: Tue, 27 Oct 2026 09:41:05 +0000
Subject: [php-src] PHP-8.6: Merge branch 'PHP-8.5' into PHP-8.6
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-142785@lists.php.net to get a copy of this message
Author: Jakub Zelenka (bukka) Date: 2026-10-27T10:40:54+01:00 Commit: https://github.com/php/php-src/commit/c226a5931c5ccdafe531bc64fe30c6e92a5f83a8 Raw diff: https://github.com/php/php-src/commit/c226a5931c5ccdafe531bc64fe30c6e92a5f83a8.diff Merge branch 'PHP-8.5' into PHP-8.6 * PHP-8.5: Add FPM test for INI diagnostics after fatal error with backtrace (#24638) Changed paths: A sapi/fpm/tests/fatal-error-backtrace-request-reset.phpt Diff: diff --git a/sapi/fpm/tests/fatal-error-backtrace-request-reset.phpt b/sapi/fpm/tests/fatal-error-backtrace-request-reset.phpt new file mode 100644 index 000000000000..da6941e5b395 --- /dev/null +++ b/sapi/fpm/tests/fatal-error-backtrace-request-reset.phpt @@ -0,0 +1,66 @@ +--TEST-- +FPM: fatal error backtrace is reset before the next request's INI diagnostics +--SKIPIF-- +<?php include "skipif.inc"; ?> +--FILE-- +<?php + +require_once "tester.inc"; + +$cfg = <<<EOT +[global] +error_log = {{FILE:LOG}} +[unconfined] +listen = {{ADDR}} +pm = static +pm.max_children = 1 +env[ZEND_ASAN_FORCE_FAST_SHUTDOWN] = 1 +EOT; + +$code = <<<'PHP' +<?php +echo getmypid(), "\n"; +if (isset($_GET['fatal'])) { + function trigger_fatal() { + eval("class RequestReset {}; class RequestReset {}"); + } + trigger_fatal(); +} +echo date_default_timezone_get(), "\n"; +PHP; + +$tester = new FPM\Tester($cfg, $code); +$tester->start(iniEntries: [ + 'fatal_error_backtraces' => '1', + 'display_errors' => '0', + 'log_errors' => '1', + 'date.timezone' => 'UTC', +]); +$tester->expectLogStartNotices(); +$response = $tester->request('fatal=1')->expectErrorPattern( + '/\APHP message: PHP Fatal error: Cannot redeclare class RequestReset\b[^\n]*\n' + . 'Stack trace:\n#0 [^\n]*: eval\(\)\n' + . '#1 [^\n]*: trigger_fatal\(\)\n#2 \{main\}\z/' +); +$pid = $response->getBody(); +var_dump(preg_match('/^\d+$/D', $pid) === 1); + +/* PHP_VALUE is applied before php_request_startup(), while shutdown is still flagged. */ +$tester->request(headers: ['PHP_VALUE' => 'date.timezone=invalid']) + ->expectBody($pid . "\nUTC") + ->expectError("PHP message: PHP Warning: PHP Request Shutdown: " + . "Invalid date.timezone value 'invalid', using 'UTC' instead in Unknown on line 0"); +$tester->terminate(); +$tester->expectLogTerminatingNotices(); +$tester->close(); + +?> +Done +--EXPECT-- +bool(true) +Done +--CLEAN-- +<?php +require_once "tester.inc"; +FPM\Tester::clean(); +?>

« previous php.cvs (#142785) next »