From a25f0c5d77d384612491c89b01c79d3946d4cb3d Mon Sep 17 00:00:00 2001 From: Weilin Du Date: Thu, 3 Sep 2026 00:00:55 +0800 Subject: [PATCH 1/5] [skip ci] UPGRADING: Fix entry for snmp_init_mib Per: https://wiki.php.net/rfc/snmp_improvements_2026#allow_the_snmp_mib_to_be_reset The new function here is snmp_init_mib not snmp_read_mib. --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 2fd0fa3a3ace..623a29b0d6c8 100644 --- a/NEWS +++ b/NEWS @@ -180,7 +180,7 @@ PHP NEWS . It is now possible to use the AES192, AES192C, AES256, and AES256C as SNMPv3 security protocols if the underlying library supports them. (eskyuu) - . It is now possible to reset the MIB tree using the new snmp_read_mib() + . It is now possible to reset the MIB tree using the new snmp_init_mib() function. (eskyuu) . Additional MIB parsing and output control functionality has been exposed via the snmp_set_mib_option(), snmp_set_output_option(), From 3d3d336e24b0c18a93697e846a1f7e4ad33a309c Mon Sep 17 00:00:00 2001 From: Weilin Du Date: Thu, 3 Sep 2026 00:06:06 +0800 Subject: [PATCH 2/5] [skip ci] Update UPGRADING with new Sodium constants This adds constants added in #20960 commit: 8a907a9 --- UPGRADING | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/UPGRADING b/UPGRADING index fb2d48a22ce9..42ee8f4228d4 100644 --- a/UPGRADING +++ b/UPGRADING @@ -878,6 +878,28 @@ PHP 8.6 UPGRADE NOTES . EAI_IDN_ENCODE. . SO_DETACH_REUSEPORT_BPF (Linux only). +- Sodium: + . SODIUM_CRYPTO_IPCRYPT_BYTES. + . SODIUM_CRYPTO_IPCRYPT_KEYBYTES. + . SODIUM_CRYPTO_IPCRYPT_ND_KEYBYTES. + . SODIUM_CRYPTO_IPCRYPT_ND_TWEAKBYTES. + . SODIUM_CRYPTO_IPCRYPT_ND_INPUTBYTES. + . SODIUM_CRYPTO_IPCRYPT_ND_OUTPUTBYTES. + . SODIUM_CRYPTO_IPCRYPT_NDX_KEYBYTES. + . SODIUM_CRYPTO_IPCRYPT_NDX_TWEAKBYTES. + . SODIUM_CRYPTO_IPCRYPT_NDX_INPUTBYTES. + . SODIUM_CRYPTO_IPCRYPT_NDX_OUTPUTBYTES. + . SODIUM_CRYPTO_IPCRYPT_PFX_KEYBYTES. + . SODIUM_CRYPTO_IPCRYPT_PFX_BYTES. + . SODIUM_CRYPTO_XOF_SHAKE128_BLOCKBYTES. + . SODIUM_CRYPTO_XOF_SHAKE128_STATEBYTES. + . SODIUM_CRYPTO_XOF_SHAKE256_BLOCKBYTES. + . SODIUM_CRYPTO_XOF_SHAKE256_STATEBYTES. + . SODIUM_CRYPTO_XOF_TURBOSHAKE128_BLOCKBYTES. + . SODIUM_CRYPTO_XOF_TURBOSHAKE128_STATEBYTES. + . SODIUM_CRYPTO_XOF_TURBOSHAKE256_BLOCKBYTES. + . SODIUM_CRYPTO_XOF_TURBOSHAKE256_STATEBYTES. + - Standard: . ARRAY_FILTER_USE_VALUE. . STREAM_CRYPTO_STATUS_NONE. From dab13a022a54f8bc03302f93ccb6484907ec1245 Mon Sep 17 00:00:00 2001 From: Volker Dusch <247397+edorian@users.noreply.github.com> Date: Wed, 2 Sep 2026 18:13:09 +0200 Subject: [PATCH 3/5] Keep EG(errors) buffer consistent on erealloc failure (#23257) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the error count only after the buffer has been resized and the new entry initialized. This prevents fatal error handling from reading past the buffer if reallocating it triggers an OOM bailout. Prefer safe_erealloc to avoid overflows --------- Co-authored-by: Tim Düsterhus --- Zend/zend.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index e58566541dd2..aa621c4daa8e 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1486,9 +1486,10 @@ ZEND_API ZEND_COLD void zend_error_zstr_at( /* This is very inefficient for a large number of errors. * Use pow2 realloc if it becomes a problem. */ - EG(num_errors)++; - EG(errors) = erealloc(EG(errors), sizeof(zend_error_info*) * EG(num_errors)); - EG(errors)[EG(num_errors)-1] = info; + uint32_t new_num_errors = EG(num_errors) + 1; + EG(errors) = safe_erealloc(EG(errors), new_num_errors, sizeof(zend_error_info*), 0); + EG(errors)[EG(num_errors)] = info; + EG(num_errors) = new_num_errors; /* Do not process non-fatal recorded error */ if (!(type & E_FATAL_ERRORS) || (type & E_DONT_BAIL)) { From 4017211fd00cf68e6a31e81dda5194ac0942b50c Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Wed, 12 Aug 2026 11:59:44 -0700 Subject: [PATCH 4/5] Add regression tests for calling `zend_version()` --- ext/opcache/tests/zend_version.phpt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ext/opcache/tests/zend_version.phpt diff --git a/ext/opcache/tests/zend_version.phpt b/ext/opcache/tests/zend_version.phpt new file mode 100644 index 000000000000..e61a0d46cfc6 --- /dev/null +++ b/ext/opcache/tests/zend_version.phpt @@ -0,0 +1,27 @@ +--TEST-- +zend_version() should be evaluated at compile time +--EXTENSIONS-- +opcache +--INI-- +opcache.enable_cli=1 +opcache.opt_debug_level=0x20000 +--FILE-- + +--EXPECTF-- +$_main: + ; (lines=7, args=0, vars=1, tmps=%d) + ; (after optimizer) + ; %s.php:%s +0000 INIT_FCALL 0 %d string("zend_version") +0001 T1 = DO_ICALL +0002 ASSIGN CV0($v) T1 +0003 INIT_FCALL 1 %d string("var_dump") +0004 SEND_VAR CV0($v) 1 +0005 DO_ICALL +0006 RETURN int(1) +string(%d) "%s" From ce7896d514b415922b344f58f45471c01de6d4a3 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Wed, 12 Aug 2026 12:02:19 -0700 Subject: [PATCH 5/5] Mark `zend_version()` as `@compile-time-eval` --- Zend/zend_builtin_functions.stub.php | 5 ++++- Zend/zend_builtin_functions_arginfo.h | 4 ++-- ext/opcache/tests/zend_version.phpt | 14 ++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Zend/zend_builtin_functions.stub.php b/Zend/zend_builtin_functions.stub.php index 1d405587145d..16ce7e2be8ca 100644 --- a/Zend/zend_builtin_functions.stub.php +++ b/Zend/zend_builtin_functions.stub.php @@ -15,7 +15,10 @@ function exit(string|int $status = 0): never {} /** @alias exit */ function die(string|int $status = 0): never {} -/** @refcount 1 */ +/** + * @refcount 1 + * @compile-time-eval + */ function zend_version(): string {} /** @forbid-dynamic-calls */ diff --git a/Zend/zend_builtin_functions_arginfo.h b/Zend/zend_builtin_functions_arginfo.h index b3af43fef340..fc8d8270b016 100644 --- a/Zend/zend_builtin_functions_arginfo.h +++ b/Zend/zend_builtin_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit zend_builtin_functions.stub.php instead. - * Stub hash: 64c61862de86d9968930893bf21b516119724064 */ + * Stub hash: 5d7145b7bc305bb50b45e75c02740206148223b1 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_clone, 0, 1, IS_OBJECT, 0) ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0) @@ -315,7 +315,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(clone, arginfo_clone) ZEND_FE(exit, arginfo_exit) ZEND_RAW_FENTRY("die", zif_exit, arginfo_die, 0, NULL, NULL) - ZEND_FE(zend_version, arginfo_zend_version) + ZEND_RAW_FENTRY("zend_version", zif_zend_version, arginfo_zend_version, ZEND_ACC_COMPILE_TIME_EVAL, NULL, NULL) #if (PHP_VERSION_ID >= 80600) ZEND_RAW_FENTRY("func_num_args", zif_func_num_args, arginfo_func_num_args, ZEND_FENTRY_FLAGS(0, ZEND_ACC2_FORBID_DYN_CALLS), NULL, NULL) #elif (PHP_VERSION_ID >= 80400) diff --git a/ext/opcache/tests/zend_version.phpt b/ext/opcache/tests/zend_version.phpt index e61a0d46cfc6..8f37bdc05353 100644 --- a/ext/opcache/tests/zend_version.phpt +++ b/ext/opcache/tests/zend_version.phpt @@ -14,14 +14,12 @@ var_dump($v); ?> --EXPECTF-- $_main: - ; (lines=7, args=0, vars=1, tmps=%d) + ; (lines=5, args=0, vars=1, tmps=%d) ; (after optimizer) ; %s.php:%s -0000 INIT_FCALL 0 %d string("zend_version") -0001 T1 = DO_ICALL -0002 ASSIGN CV0($v) T1 -0003 INIT_FCALL 1 %d string("var_dump") -0004 SEND_VAR CV0($v) 1 -0005 DO_ICALL -0006 RETURN int(1) +0000 ASSIGN CV0($v) string("%s") +0001 INIT_FCALL 1 %d string("var_dump") +0002 SEND_VAR CV0($v) 1 +0003 DO_ICALL +0004 RETURN int(1) string(%d) "%s"