From 86a3bdfaeea44938c8b301aea2f8dcbb4f3954b5 Mon Sep 17 00:00:00 2001 From: Saki Takamachi Date: Tue, 7 Oct 2025 23:31:32 +0900 Subject: [PATCH 1/8] PHP-8.4 is now for PHP 8.4.15-dev --- NEWS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index b5349e815d9a..c5c622f27ca0 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.4.14 +?? ??? ????, PHP 8.4.15 + + +09 Oct 2025, PHP 8.4.14 - Core: . Fixed bug GH-19765 (object_properties_load() bypasses readonly property From 1edcce5554b13b631d900950897895e58b1e2182 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 7 Oct 2025 18:33:17 +0200 Subject: [PATCH 2/8] Backport more curl 8.16 fixes This hunk was missed in the 8.1 cherry-pick because curl_xferinfo() didn't exist yet. --- ext/curl/interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 2bc20070a955..1f2fade37dbf 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -716,11 +716,11 @@ static int curl_progress(void *clientp, double dltotal, double dlnow, double ult #if LIBCURL_VERSION_NUM >= 0x072000 /* {{{ curl_xferinfo */ -static size_t curl_xferinfo(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) +static int curl_xferinfo(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) { php_curl *ch = (php_curl *)clientp; php_curl_callback *t = ch->handlers.xferinfo; - size_t rval = 0; + int rval = 0; #if PHP_CURL_DEBUG fprintf(stderr, "curl_xferinfo() called\n"); From 9bc35f19822026a7835f1baf71418745b180bf50 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 18 Sep 2025 11:57:38 +0200 Subject: [PATCH 3/8] Fix CGI with auto_globals_jit=0 In CGI, php_auto_globals_create_server() (i.e. auto_global_callback() here) initializes $_ENV to reuse for $_SERVER. However, because $_SERVER is constructed first, we have not yet initialized auto_global->armed of the $_ENV global. Split the loop into initialization and constructor phases. Fixes GH-19934 Closes GH-19870 --- NEWS | 1 + Zend/zend_compile.c | 10 +++++----- sapi/cgi/tests/auto_globals_no_jit.phpt | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 sapi/cgi/tests/auto_globals_no_jit.phpt diff --git a/NEWS b/NEWS index 026aac13e69f..f56f04dd84fa 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ PHP NEWS . Fixed bug GH-19480 (error_log php.ini cannot be unset when open_basedir is configured). (nielsdos) . Fixed bug GH-20002 (Broken build on *BSD with MSAN). (outtersg) + . Fixed bug GH-19934 (CGI with auto_globals_jit=0 causes uouv). (ilutov) - CLI: . Fix useless "Failed to poll event" error logs due to EAGAIN in CLI server diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 5d25b3963834..3679643fc847 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1938,12 +1938,12 @@ ZEND_API void zend_activate_auto_globals(void) /* {{{ */ zend_auto_global *auto_global; ZEND_HASH_MAP_FOREACH_PTR(CG(auto_globals), auto_global) { - if (auto_global->jit) { - auto_global->armed = 1; - } else if (auto_global->auto_global_callback) { + auto_global->armed = auto_global->jit || auto_global->auto_global_callback; + } ZEND_HASH_FOREACH_END(); + + ZEND_HASH_MAP_FOREACH_PTR(CG(auto_globals), auto_global) { + if (auto_global->armed && !auto_global->jit) { auto_global->armed = auto_global->auto_global_callback(auto_global->name); - } else { - auto_global->armed = 0; } } ZEND_HASH_FOREACH_END(); } diff --git a/sapi/cgi/tests/auto_globals_no_jit.phpt b/sapi/cgi/tests/auto_globals_no_jit.phpt new file mode 100644 index 000000000000..e331709db6db --- /dev/null +++ b/sapi/cgi/tests/auto_globals_no_jit.phpt @@ -0,0 +1,17 @@ +--TEST-- +CGI with auto_globals_jit=0 +--INI-- +auto_globals_jit=0 +--CGI-- +--ENV-- +FOO=BAR +--FILE-- + +--EXPECT-- +string(3) "BAR" +string(3) "BAR" +string(3) "BAR" From 2f4b8e691ad1b31c9ba0263e4e59218e728e9e65 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 7 Oct 2025 15:39:12 +0200 Subject: [PATCH 4/8] ensure test passes with prod config --- sapi/cgi/tests/auto_globals_no_jit.phpt | 1 + 1 file changed, 1 insertion(+) diff --git a/sapi/cgi/tests/auto_globals_no_jit.phpt b/sapi/cgi/tests/auto_globals_no_jit.phpt index e331709db6db..21af9e038d2a 100644 --- a/sapi/cgi/tests/auto_globals_no_jit.phpt +++ b/sapi/cgi/tests/auto_globals_no_jit.phpt @@ -2,6 +2,7 @@ CGI with auto_globals_jit=0 --INI-- auto_globals_jit=0 +variables_order="EGPCS" --CGI-- --ENV-- FOO=BAR From 9b20618e1b18a8783deda21ec8d7020a52ab8302 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 7 Oct 2025 18:49:28 +0200 Subject: [PATCH 5/8] [skip ci] Fix news entry Every time... --- NEWS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index f56f04dd84fa..de36d0c9fa66 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.3.28 +- Core: + . Fixed bug GH-19934 (CGI with auto_globals_jit=0 causes uouv). (ilutov) 23 Oct 2025, PHP 8.3.27 @@ -18,7 +20,6 @@ PHP NEWS . Fixed bug GH-19480 (error_log php.ini cannot be unset when open_basedir is configured). (nielsdos) . Fixed bug GH-20002 (Broken build on *BSD with MSAN). (outtersg) - . Fixed bug GH-19934 (CGI with auto_globals_jit=0 causes uouv). (ilutov) - CLI: . Fix useless "Failed to poll event" error logs due to EAGAIN in CLI server From b16761ec11a2c103dc1e6f20896ed9421011598c Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:51:23 +0200 Subject: [PATCH 6/8] Fix GH-20073: Assertion failure in WeakMap offset operations on reference Closes GH-20078. --- NEWS | 2 ++ Zend/tests/weakrefs/gh20073.phpt | 15 +++++++++++++++ Zend/zend_weakrefs.c | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/weakrefs/gh20073.phpt diff --git a/NEWS b/NEWS index de36d0c9fa66..b2b8aaacf152 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ PHP NEWS - Core: . Fixed bug GH-19934 (CGI with auto_globals_jit=0 causes uouv). (ilutov) + . Fixed bug GH-20073 (Assertion failure in WeakMap offset operations on + reference). (nielsdos) 23 Oct 2025, PHP 8.3.27 diff --git a/Zend/tests/weakrefs/gh20073.phpt b/Zend/tests/weakrefs/gh20073.phpt new file mode 100644 index 000000000000..b64c1a68d3cc --- /dev/null +++ b/Zend/tests/weakrefs/gh20073.phpt @@ -0,0 +1,15 @@ +--TEST-- +GH-20073 (Assertion failure in WeakMap offset operations on reference) +--FILE-- +offsetGet($obj)); +?> +--EXPECT-- +int(2) +int(2) diff --git a/Zend/zend_weakrefs.c b/Zend/zend_weakrefs.c index e96e68e3b274..cffaeb985aed 100644 --- a/Zend/zend_weakrefs.c +++ b/Zend/zend_weakrefs.c @@ -702,7 +702,7 @@ ZEND_METHOD(WeakMap, offsetGet) return; } - ZVAL_COPY(return_value, zv); + RETURN_COPY_DEREF(zv); } ZEND_METHOD(WeakMap, offsetSet) From 985d68150179b01b028d7cb179d4e32fca140d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 7 Oct 2025 20:44:32 +0200 Subject: [PATCH 7/8] tree-wide: Replace `zval_is_true()` by `zend_is_true()` (#20065) * tree-wide: Replace `zval_is_true()` by `zend_is_true()` The former is a direct alias of the latter which is much more often used. * zend_operators: Remove `zval_is_true()` --- UPGRADING.INTERNALS | 2 ++ Zend/zend_compile.c | 2 +- Zend/zend_operators.c | 14 +++++++------- Zend/zend_operators.h | 3 --- ext/mysqli/mysqli.c | 2 +- ext/pdo/pdo_dbh.c | 2 +- ext/pdo_odbc/odbc_stmt.c | 2 +- ext/pgsql/pgsql.c | 2 +- ext/session/session.c | 6 +++--- ext/sockets/multicast.c | 4 ++-- ext/standard/head.c | 6 +++--- ext/standard/http_fopen_wrapper.c | 2 +- main/streams/userspace.c | 20 ++++++++++---------- 13 files changed, 33 insertions(+), 34 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index c2ec44e1e0c2..ada814964fc5 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -20,6 +20,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES . The misnamed ZVAL_IS_NULL() has been removed. Use Z_ISNULL() instead. . New zend_class_entry.ce_flags2 and zend_function.fn_flags2 fields were added, given the primary flags were running out of bits. + . The zval_is_true() alias of zend_is_true() has been removed. Call + zend_is_true() directly instead. ======================== 2. Build system changes diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a0215611b610..7d4b900990b5 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -12062,7 +12062,7 @@ bool zend_try_ct_eval_cast(zval *result, uint32_t type, zval *op1) } switch (type) { case _IS_BOOL: - ZVAL_BOOL(result, zval_is_true(op1)); + ZVAL_BOOL(result, zend_is_true(op1)); return true; case IS_LONG: if (Z_TYPE_P(op1) == IS_DOUBLE && !ZEND_DOUBLE_FITS_LONG(Z_DVAL_P((op1)))) { diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 9740de7d081f..2550fcbeb1cd 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1593,7 +1593,7 @@ ZEND_API zend_result ZEND_FASTCALL boolean_xor_function(zval *result, zval *op1, } } ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BOOL_XOR); - op1_val = zval_is_true(op1); + op1_val = zend_is_true(op1); } } while (0); do { @@ -1613,7 +1613,7 @@ ZEND_API zend_result ZEND_FASTCALL boolean_xor_function(zval *result, zval *op1, } } ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BOOL_XOR); - op2_val = zval_is_true(op2); + op2_val = zend_is_true(op2); } } while (0); @@ -1641,7 +1641,7 @@ ZEND_API zend_result ZEND_FASTCALL boolean_not_function(zval *result, zval *op1) } ZEND_TRY_UNARY_OBJECT_OPERATION(ZEND_BOOL_NOT); - ZVAL_BOOL(result, !zval_is_true(op1)); + ZVAL_BOOL(result, !zend_is_true(op1)); } return SUCCESS; } @@ -2433,13 +2433,13 @@ ZEND_API int ZEND_FASTCALL zend_compare(zval *op1, zval *op2) /* {{{ */ converted = true; } } else if (Z_TYPE_P(op1) < IS_TRUE) { - return zval_is_true(op2) ? -1 : 0; + return zend_is_true(op2) ? -1 : 0; } else if (Z_TYPE_P(op1) == IS_TRUE) { - return zval_is_true(op2) ? 0 : 1; + return zend_is_true(op2) ? 0 : 1; } else if (Z_TYPE_P(op2) < IS_TRUE) { - return zval_is_true(op1) ? 1 : 0; + return zend_is_true(op1) ? 1 : 0; } else if (Z_TYPE_P(op2) == IS_TRUE) { - return zval_is_true(op1) ? 0 : -1; + return zend_is_true(op1) ? 0 : -1; } else { op1 = _zendi_convert_scalar_to_number_silent(op1, &op1_copy); op2 = _zendi_convert_scalar_to_number_silent(op2, &op2_copy); diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index a3bf19fca8f2..4a74e6ebaefe 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -404,9 +404,6 @@ static zend_always_inline bool try_convert_to_string(zval *op) { ZEND_API bool ZEND_FASTCALL zend_is_true(const zval *op); ZEND_API bool ZEND_FASTCALL zend_object_is_true(const zval *op); -#define zval_is_true(op) \ - zend_is_true(op) - static zend_always_inline bool i_zend_is_true(const zval *op) { bool result = 0; diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index dddb53585f14..a46b16e1d1ec 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -316,7 +316,7 @@ static int mysqli_object_has_property(zend_object *object, zend_string *name, in zval rv; zval *value = mysqli_read_property(object, name, BP_VAR_IS, cache_slot, &rv); if (value != &EG(uninitialized_zval)) { - has_property = zval_is_true(value); + has_property = zend_is_true(value); zval_ptr_dtor(value); } break; diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index b34653e28672..2eaa3940f82e 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -805,7 +805,7 @@ PDO_API bool pdo_get_bool_param(bool *bval, const zval *value) *bval = false; return true; case IS_LONG: - *bval = zval_is_true(value); + *bval = zend_is_true(value); return true; case IS_STRING: /* TODO Should string be allowed? */ default: diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index 8e27d27173c0..171fb7b7b1e9 100644 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -803,7 +803,7 @@ static int odbc_stmt_set_param(pdo_stmt_t *stmt, zend_long attr, zval *val) return 0; case PDO_ODBC_ATTR_ASSUME_UTF8: - S->assume_utf8 = zval_is_true(val); + S->assume_utf8 = zend_is_true(val); return 0; default: strcpy(S->einfo.last_err_msg, "Unknown Attribute"); diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index feea2ed60e6f..dbb875e88f19 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -4967,7 +4967,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string * break; /* break out for() */ } - if (zval_is_true(is_enum)) { + if (zend_is_true(is_enum)) { /* enums need to be treated like strings */ data_type = PG_TEXT; } else { diff --git a/ext/session/session.c b/ext/session/session.c index 1c01201a55bc..8796005e9232 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1858,15 +1858,15 @@ PHP_FUNCTION(session_set_cookie_params) domain = zval_get_string(value); found++; } else if (zend_string_equals_literal_ci(key, "secure")) { - secure = zval_is_true(value); + secure = zend_is_true(value); secure_null = 0; found++; } else if (zend_string_equals_literal_ci(key, "partitioned")) { - partitioned = zval_is_true(value); + partitioned = zend_is_true(value); partitioned_null = 0; found++; } else if (zend_string_equals_literal_ci(key, "httponly")) { - httponly = zval_is_true(value); + httponly = zend_is_true(value); httponly_null = 0; found++; } else if (zend_string_equals_literal_ci(key, "samesite")) { diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index f331fd177ebf..522e6b346f66 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -293,7 +293,7 @@ int php_do_setsockopt_ip_mcast(php_socket *php_sock, goto dosockopt; case IP_MULTICAST_LOOP: - ipv4_mcast_ttl_lback = (unsigned char) zval_is_true(arg4); + ipv4_mcast_ttl_lback = (unsigned char) zend_is_true(arg4); goto ipv4_loop_ttl; case IP_MULTICAST_TTL: @@ -357,7 +357,7 @@ int php_do_setsockopt_ipv6_mcast(php_socket *php_sock, goto dosockopt; case IPV6_MULTICAST_LOOP: - ov = (int) zval_is_true(arg4); + ov = (int) zend_is_true(arg4); goto ipv6_loop_hops; case IPV6_MULTICAST_HOPS: convert_to_long(arg4); diff --git a/ext/standard/head.c b/ext/standard/head.c index 087ba6a34806..76ba89dc0171 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -213,13 +213,13 @@ static zend_result php_head_parse_cookie_options_array(HashTable *options, zend_ } else if (zend_string_equals_literal_ci(key, "domain")) { *domain = zval_get_string(value); } else if (zend_string_equals_literal_ci(key, "secure")) { - *secure = zval_is_true(value); + *secure = zend_is_true(value); } else if (zend_string_equals_literal_ci(key, "httponly")) { - *httponly = zval_is_true(value); + *httponly = zend_is_true(value); } else if (zend_string_equals_literal_ci(key, "samesite")) { *samesite = zval_get_string(value); } else if (zend_string_equals_literal_ci(key, "partitioned")) { - *partitioned = zval_is_true(value); + *partitioned = zend_is_true(value); } else { zend_value_error("%s(): option \"%s\" is invalid", get_active_function_name(), ZSTR_VAL(key)); return FAILURE; diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index b7087befcb27..da150381f43f 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -276,7 +276,7 @@ static zend_string *php_stream_http_response_headers_parse(php_stream_wrapper *w if (!strncasecmp(last_header_line, "Location:", sizeof("Location:")-1)) { /* Check if the location should be followed. */ if (context && (tmpzval = php_stream_context_get_option(context, "http", "follow_location")) != NULL) { - header_info->follow_location = zval_is_true(tmpzval); + header_info->follow_location = zend_is_true(tmpzval); } else if (!((response_code >= 300 && response_code < 304) || 307 == response_code || 308 == response_code)) { /* The redirection should not be automatic if follow_location is not set and diff --git a/main/streams/userspace.c b/main/streams/userspace.c index deae2ff5d2d3..b1ea8818aecc 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -346,7 +346,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char * zval_ptr_dtor(&args[3]); goto end; } - if (zval_is_true(&zretval)) { + if (zend_is_true(&zretval)) { /* the stream is now open! */ stream = php_stream_alloc_rel(&php_stream_userspace_ops, us, 0, mode); @@ -430,7 +430,7 @@ static php_stream *user_wrapper_opendir(php_stream_wrapper *wrapper, const char goto end; } - if (zval_is_true(&zretval)) { + if (zend_is_true(&zretval)) { /* the stream is now open! */ stream = php_stream_alloc_rel(&php_stream_userspace_dir_ops, us, 0, mode); @@ -672,7 +672,7 @@ static ssize_t php_userstreamop_read(php_stream *stream, char *buf, size_t count goto err; } - if (zval_is_true(&retval)) { + if (zend_is_true(&retval)) { stream->eof = 1; } zval_ptr_dtor(&retval); @@ -720,7 +720,7 @@ static int php_userstreamop_flush(php_stream *stream) zend_result call_result = zend_call_method_if_exists(Z_OBJ(us->object), func_name, &retval, 0, NULL); zend_string_release_ex(func_name, false); - int ret = call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zval_is_true(&retval) ? 0 : -1; + int ret = call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zend_is_true(&retval) ? 0 : -1; zval_ptr_dtor(&retval); @@ -755,7 +755,7 @@ static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int when ret = -1; goto out; - } else if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zval_is_true(&retval)) { + } else if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF && zend_is_true(&retval)) { ret = 0; } else { ret = -1; @@ -1090,7 +1090,7 @@ static int user_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int } else if (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE) { ret = Z_TYPE(zretval) == IS_TRUE; } - // TODO: Warn on invalid return type, or use zval_is_true()? + // TODO: Warn on invalid return type, or use zend_is_true()? zval_ptr_dtor(&zretval); @@ -1128,7 +1128,7 @@ static int user_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from } else if (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE) { ret = Z_TYPE(zretval) == IS_TRUE; } - // TODO: Warn on invalid return type, or use zval_is_true()? + // TODO: Warn on invalid return type, or use zend_is_true()? zval_ptr_dtor(&zretval); @@ -1166,7 +1166,7 @@ static int user_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url, int } else if (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE) { ret = Z_TYPE(zretval) == IS_TRUE; } - // TODO: Warn on invalid return type, or use zval_is_true()? + // TODO: Warn on invalid return type, or use zend_is_true()? zval_ptr_dtor(&zretval); @@ -1203,7 +1203,7 @@ static int user_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, } else if (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE) { ret = Z_TYPE(zretval) == IS_TRUE; } - // TODO: Warn on invalid return type, or use zval_is_true()? + // TODO: Warn on invalid return type, or use zend_is_true()? zval_ptr_dtor(&zretval); @@ -1265,7 +1265,7 @@ static int user_wrapper_metadata(php_stream_wrapper *wrapper, const char *url, i } else if (Z_TYPE(zretval) == IS_FALSE || Z_TYPE(zretval) == IS_TRUE) { ret = Z_TYPE(zretval) == IS_TRUE; } - // TODO: Warn on invalid return type, or use zval_is_true()? + // TODO: Warn on invalid return type, or use zend_is_true()? zval_ptr_dtor(&zretval); From 53b0a9554549fb93ebcade34a72c6151dc02b8ee Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Tue, 7 Oct 2025 22:12:52 +0200 Subject: [PATCH 8/8] Avoid hardcoding the offset for ErrorException specific properties (#20096) While I consider it fine to hardcode offsets for parent-less classes, doing it on inherited classes prohibits adding additional properties via extensions. In this specific case, an added property to Exception will cause "new ErrorException" to crash. Signed-off-by: Bob Weinand --- Zend/zend_exceptions.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 0b0945aac0f4..77b754c91086 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -36,7 +36,6 @@ #define ZEND_EXCEPTION_LINE_OFF 4 #define ZEND_EXCEPTION_TRACE_OFF 5 #define ZEND_EXCEPTION_PREVIOUS_OFF 6 -#define ZEND_EXCEPTION_SEVERITY_OFF 7 ZEND_API zend_class_entry *zend_ce_throwable; ZEND_API zend_class_entry *zend_ce_exception; @@ -415,7 +414,7 @@ ZEND_METHOD(ErrorException, __construct) } ZVAL_LONG(&tmp, severity); - zend_update_property_num_checked(NULL, Z_OBJ_P(object), ZEND_EXCEPTION_SEVERITY_OFF, ZSTR_KNOWN(ZEND_STR_SEVERITY), &tmp); + zend_update_property_ex(zend_ce_exception, Z_OBJ_P(object), ZSTR_KNOWN(ZEND_STR_SEVERITY), &tmp); if (UNEXPECTED(EG(exception))) { RETURN_THROWS(); }