Skip to content

Commit 003b60a

Browse files
cleanup
1 parent b712b5b commit 003b60a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Zend/tests/readonly_props/cpp_reassign_child_redefine.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Promoted readonly property reassignment in constructor - child redefines parent
44
<?php
55

66
// Case 1: Parent uses CPP, child redefines as non-promoted, child tries to reassign.
7-
// The property is owned by C1; parent CPP sets its initial value, but child's
8-
// non-promoted redefinition means no reassignment window exists for the child.
7+
// P1 owns the CPP reassignment window; it is cleared when P1's constructor exits,
8+
// before C1's body runs. So C1's write attempt fails.
99
class P1 {
1010
public function __construct(
1111
public readonly string $x = 'P',

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ ZEND_API bool zend_never_inline zend_verify_property_type(const zend_property_in
10681068
return i_zend_verify_property_type(info, property, strict);
10691069
}
10701070

1071-
static zend_never_inline zval* zend_assign_to_typed_prop(const zend_property_info *info, zval *property_val, zval *value, zend_refcounted **garbage_ptr, zend_object *zobj EXECUTE_DATA_DC)
1071+
static zend_never_inline zval* zend_assign_to_typed_prop(const zend_property_info *info, zval *property_val, zval *value, zend_refcounted **garbage_ptr EXECUTE_DATA_DC)
10721072
{
10731073
zval tmp;
10741074

Zend/zend_vm_def.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,7 +2525,7 @@ ZEND_VM_C_LABEL(assign_obj_simple):
25252525
property_val = OBJ_PROP(zobj, prop_offset);
25262526
if (Z_TYPE_P(property_val) != IS_UNDEF) {
25272527
if (prop_info != NULL) {
2528-
value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage, zobj EXECUTE_DATA_CC);
2528+
value = zend_assign_to_typed_prop(prop_info, property_val, value, &garbage EXECUTE_DATA_CC);
25292529
ZEND_VM_C_GOTO(free_and_exit_assign_obj);
25302530
} else {
25312531
ZEND_VM_C_LABEL(fast_assign_obj):
@@ -2660,7 +2660,7 @@ ZEND_VM_HANDLER(25, ZEND_ASSIGN_STATIC_PROP, ANY, ANY, CACHE_SLOT, SPEC(OP_DATA=
26602660
value = GET_OP_DATA_ZVAL_PTR(BP_VAR_R);
26612661

26622662
if (ZEND_TYPE_IS_SET(prop_info->type)) {
2663-
value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage, NULL EXECUTE_DATA_CC);
2663+
value = zend_assign_to_typed_prop(prop_info, prop, value, &garbage EXECUTE_DATA_CC);
26642664
FREE_OP_DATA();
26652665
} else {
26662666
value = zend_assign_to_variable_ex(prop, value, OP_DATA_TYPE, EX_USES_STRICT_TYPES(), &garbage);

0 commit comments

Comments
 (0)