[php-src] PHP-8.6: Merge branch 'PHP-8.5' of ../PHP-8.5 into PHP-8.6
| From: | Levi Morrison | Date: | Fri, 09 Oct 2026 15:22:43 +0000 |
| Subject: | [php-src] PHP-8.6: Merge branch 'PHP-8.5' of ../PHP-8.5 into PHP-8.6 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142120@lists.php.net to get a copy of this message | ||
Author: Levi Morrison (morrisonlevi)
Date: 2026-10-09T09:20:26-06:00
Commit: https://github.com/php/php-src/commit/0ba344d48608fe0f86cf21bf9e48b746e75b15df
Raw diff: https://github.com/php/php-src/commit/0ba344d48608fe0f86cf21bf9e48b746e75b15df.diff
Merge branch 'PHP-8.5' of ../PHP-8.5 into PHP-8.6
Changed paths:
A ext/zend_test/tests/system_id_reinitialization.phpt
M NEWS
M Zend/zend_system_id.c
M ext/zend_test/test.c
Diff:
diff --git a/NEWS b/NEWS
index 44176bcb54f0..7d7578074147 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ PHP NEWS
?? ??? ????, PHP 8.6.0RC4
- Core:
+ . Fixed bug GH-24184 (System ID not being reinitialized after an Apache
+ graceful restart, potentially causing incompatible OPcache file cache
+ entries to be reused). (Levi Morrison)
. Fixed memory leak when an exception already contains the pending exception
in its previous chain. (Edmond)
. Fixed bug GH-23979 (Nullsafe operator must not flush delayed oplines of an
diff --git a/Zend/zend_system_id.c b/Zend/zend_system_id.c
index aaeb254386b7..3e5077279b7e 100644
--- a/Zend/zend_system_id.c
+++ b/Zend/zend_system_id.c
@@ -40,6 +40,7 @@ ZEND_API zend_result zend_add_system_entropy(const char *module_name, const char
void zend_startup_system_id(void)
{
+ finalized = 0;
PHP_MD5Init(&context);
PHP_MD5Update(&context, PHP_VERSION, sizeof(PHP_VERSION)-1);
PHP_MD5Update(&context, ZEND_EXTENSION_BUILD_ID, sizeof(ZEND_EXTENSION_BUILD_ID)-1);
diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c
index fa9b43b68c59..3b6ee7390e21 100644
--- a/ext/zend_test/test.c
+++ b/ext/zend_test/test.c
@@ -36,6 +36,7 @@
#include "tmp_methods_arginfo.h"
#include "zend_call_stack.h"
#include "zend_exceptions.h"
+#include "zend_system_id.h"
#include "zend_mm_custom_handlers.h"
#include "ext/uri/php_uri.h"
#include "zend_observer.h"
@@ -2037,6 +2038,7 @@ static ZEND_METHOD(_ZendTestMagicCallForward, __call)
}
PHP_INI_BEGIN()
+ PHP_INI_ENTRY("zend_test.register_system_entropy", "0", PHP_INI_SYSTEM, NULL)
STD_PHP_INI_BOOLEAN("zend_test.replace_zend_execute_ex", "0", PHP_INI_SYSTEM,
OnUpdateBool, replace_zend_execute_ex, zend_zend_test_globals, zend_test_globals)
STD_PHP_INI_BOOLEAN("zend_test.register_passes", "0", PHP_INI_SYSTEM,
OnUpdateBool, register_passes, zend_zend_test_globals, zend_test_globals)
STD_PHP_INI_BOOLEAN("zend_test.print_stderr_mshutdown", "0", PHP_INI_SYSTEM,
OnUpdateBool, print_stderr_mshutdown, zend_zend_test_globals, zend_test_globals)
@@ -2243,6 +2245,10 @@ PHP_MINIT_FUNCTION(zend_test)
// Loading via dl() not supported with the observer API
if (type != MODULE_TEMPORARY) {
REGISTER_INI_ENTRIES();
+ if (INI_BOOL("zend_test.register_system_entropy") &&
+ zend_add_system_entropy("zend_test", "test", ZEND_STRL("test
entropy")) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Failed to register system entropy");
+ }
} else {
(void)ini_entries;
}
diff --git a/ext/zend_test/tests/system_id_reinitialization.phpt
b/ext/zend_test/tests/system_id_reinitialization.phpt
new file mode 100644
index 000000000000..5e80b567c621
--- /dev/null
+++ b/ext/zend_test/tests/system_id_reinitialization.phpt
@@ -0,0 +1,40 @@
+--TEST--
+System ID reinitialization accepts extension entropy after engine restart
+--SKIPIF--
+<?php
+if (!extension_loaded('zend_test')) die('skip zend_test extension required');
+?>
+--INI--
+zend_test.register_system_entropy=1
+--PHPDBG--
+r
+clean
+r
+clean
+r
+q
+--FILE--
+<?php
+echo "Done\n";
+?>
+--EXPECTF--
+[Successful compilation of %s]
+prompt> Done
+[Script ended normally]
+prompt> Cleaning Execution Environment
+Classes %d
+Functions %d
+Constants %d
+Includes 0
+[Script ended normally]
+prompt> Done
+[Script ended normally]
+prompt> Cleaning Execution Environment
+Classes %d
+Functions %d
+Constants %d
+Includes 0
+[Script ended normally]
+prompt> Done
+[Script ended normally]
+prompt>