From 1302b9f6da16303ad3f3d23f98061c75261d6bcf Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 22 Sep 2025 20:14:21 +0300 Subject: [PATCH 1/3] Update IR IR commit: 425ca45ffed99b6d3085c6a7f7c9d4fb3c2b5737 --- ext/opcache/jit/ir/ir_aarch64.dasc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/opcache/jit/ir/ir_aarch64.dasc b/ext/opcache/jit/ir/ir_aarch64.dasc index 4cdf4d68c2179..2caabb3ebebbb 100644 --- a/ext/opcache/jit/ir/ir_aarch64.dasc +++ b/ext/opcache/jit/ir/ir_aarch64.dasc @@ -4457,7 +4457,7 @@ static void ir_emit_va_arg(ir_ctx *ctx, ir_ref def, ir_insn *insn) } else { IR_ASSERT(ir_rule(ctx, insn->op2) == IR_STATIC_ALLOCA); op2_reg = (ctx->flags & IR_USE_FRAME_POINTER) ? IR_REG_FRAME_POINTER : IR_REG_STACK_POINTER; - offset = ir_local_offset(ct, &ctx->ir_base[insn->op2]); + offset = ir_local_offset(ctx, &ctx->ir_base[insn->op2]); } | ldr Rx(tmp_reg), [Rx(op2_reg), #offset] ir_emit_load_mem(ctx, type, def_reg, IR_MEM_BO(tmp_reg, 0)); From 78c997f36f642b85960f81f4fe1ffd1989dcb7d8 Mon Sep 17 00:00:00 2001 From: sasezaki Date: Sun, 21 Sep 2025 22:13:27 +0900 Subject: [PATCH 2/3] Make ReflectionConstant non-final Fixes GH-19747 Closes GH-19901 --- NEWS | 3 +++ UPGRADING | 3 +++ ext/reflection/php_reflection.stub.php | 2 +- ext/reflection/php_reflection_arginfo.h | 4 ++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 0b66ccd0a91b3..ece950165ad30 100644 --- a/NEWS +++ b/NEWS @@ -53,6 +53,9 @@ PHP NEWS - MBstring: . Updated Unicode data tables to Unicode 17.0. (Yuya Hamada) +- Reflection: + . ReflectionConstant is no longer final. (sasezaki) + - Standard: . Passing strings which are not one byte long to ord() is now deprecated. (Girgias) diff --git a/UPGRADING b/UPGRADING index fc6000686c4eb..92288ec984514 100644 --- a/UPGRADING +++ b/UPGRADING @@ -862,6 +862,9 @@ PHP 8.5 UPGRADE NOTES readline_callback_handler_install() have been changed to true, rather than bool. +- Reflection: + . ReflectionConstant is no longer final. + ======================================== 10. New Global Constants ======================================== diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php index 7af884953bef3..be372ac729912 100644 --- a/ext/reflection/php_reflection.stub.php +++ b/ext/reflection/php_reflection.stub.php @@ -904,7 +904,7 @@ public function getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array { * @strict-properties * @not-serializable */ -final class ReflectionConstant implements Reflector +class ReflectionConstant implements Reflector { public string $name; diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h index 907ada13efab1..6465c659c733b 100644 --- a/ext/reflection/php_reflection_arginfo.h +++ b/ext/reflection/php_reflection_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 0f6ecac0c6c4fb4af140a1be95f6a50c7532dae9 */ + * Stub hash: 576229f7a0c4afd2f8902db6ce87daa51256965e */ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0) @@ -1894,7 +1894,7 @@ static zend_class_entry *register_class_ReflectionConstant(zend_class_entry *cla zend_class_entry ce, *class_entry; INIT_CLASS_ENTRY(ce, "ReflectionConstant", class_ReflectionConstant_methods); - class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE); + class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE); zend_class_implements(class_entry, 1, class_entry_Reflector); zval property_name_default_value; From 6e1b1900f00f2529c1330c03c5cb87e6f3cfa905 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 18 Sep 2025 03:25:31 +0200 Subject: [PATCH 3/3] Mark enums and static fake closures as not collectable Closes GH-19866 --- Zend/zend_closures.c | 3 +++ Zend/zend_enum.c | 1 + 2 files changed, 4 insertions(+) diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 22fd30463726f..4a6b5a5218849 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -866,6 +866,9 @@ ZEND_API void zend_create_fake_closure(zval *res, zend_function *func, zend_clas closure = (zend_closure *)Z_OBJ_P(res); closure->func.common.fn_flags |= ZEND_ACC_FAKE_CLOSURE; + if (Z_TYPE(closure->this_ptr) != IS_OBJECT) { + GC_ADD_FLAGS(&closure->std, GC_NOT_COLLECTABLE); + } } /* }}} */ diff --git a/Zend/zend_enum.c b/Zend/zend_enum.c index 6baa34cc50125..ae9e7b701213f 100644 --- a/Zend/zend_enum.c +++ b/Zend/zend_enum.c @@ -39,6 +39,7 @@ ZEND_API zend_object_handlers zend_enum_object_handlers; zend_object *zend_enum_new(zval *result, zend_class_entry *ce, zend_string *case_name, zval *backing_value_zv) { zend_object *zobj = zend_objects_new(ce); + GC_ADD_FLAGS(zobj, GC_NOT_COLLECTABLE); ZVAL_OBJ(result, zobj); zval *zname = OBJ_PROP_NUM(zobj, 0);