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(), 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. diff --git a/Zend/zend.c b/Zend/zend.c index 1718972e592f..42e6fb568a22 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1487,13 +1487,14 @@ ZEND_API ZEND_COLD void zend_error_zstr_at( info->lineno = error_lineno; info->filename = zend_string_copy(error_filename); info->message = zend_string_copy(message); - EG(errors).size++; - if (EG(errors).size > EG(errors).capacity) { + uint32_t new_size = EG(errors).size + 1; + if (new_size > EG(errors).capacity) { uint32_t capacity = EG(errors).capacity ? EG(errors).capacity + (EG(errors).capacity >> 1) : 2; EG(errors).errors = erealloc(EG(errors).errors, sizeof(zend_error_info *) * capacity); EG(errors).capacity = capacity; } - EG(errors).errors[EG(errors).size - 1] = info; + EG(errors).errors[EG(errors).size] = info; + EG(errors).size = new_size; /* Do not process non-fatal recorded error */ if (!(type & E_FATAL_ERRORS) || (type & E_DONT_BAIL)) { 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 new file mode 100644 index 000000000000..8f37bdc05353 --- /dev/null +++ b/ext/opcache/tests/zend_version.phpt @@ -0,0 +1,25 @@ +--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=5, args=0, vars=1, tmps=%d) + ; (after optimizer) + ; %s.php:%s +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"