com php-src: lift unset restriction, possibly temporarily while we argue about stuff ...: Zend/tests/type_declarations/typed_propert ies_009.phpt
Zend/zend_object_handlers.c Ze nd/zend_vm_def.h Zend/zend_vm_execute.h
| From: | Bob Weinand | Date: | Fri, 18 Mar 2016 12:39:52 +0000 |
| Subject: | com php-src: lift unset restriction, possibly temporarily while we argue about stuff ...: Zend/tests/type_declarations/typed_propert ies_009.phpt Zend/zend_object_handlers.c Ze nd/zend_vm_def.h Zend/zend_vm_execute.h |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95680@lists.php.net to get a copy of this message | ||
Commit: 72e330a508f66aac053918f604c3d202e06f79e4
Author: Joe Watkins <krakjoe@php.net> Fri, 18 Mar 2016 12:39:52 +0000
Parents: 3628c34a2c01cfc4bd863e44510280c241430311
Branches: typed_ref_properties
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=72e330a508f66aac053918f604c3d202e06f79e4
Log:
lift unset restriction, possibly temporarily while we argue about stuff ...
Changed paths:
M Zend/tests/type_declarations/typed_properties_009.phpt
M Zend/zend_object_handlers.c
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
diff --git a/Zend/tests/type_declarations/typed_properties_009.phpt b/Zend/tests/type_declarations/typed_properties_009.phpt index 5d74952..9c0b1ff 100644 --- a/Zend/tests/type_declarations/typed_properties_009.phpt +++ b/Zend/tests/type_declarations/typed_properties_009.phpt @@ -1,18 +1,27 @@ --TEST-- -Test typed properties disallow unset +Test typed properties unset leaves properties in an uninitialized state --FILE-- <?php class Foo { public int $bar; + + public function __get($name) { + var_dump($name); + } } $foo = new Foo(); + unset($foo->bar); + +var_dump($foo->bar); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Typed property Foo::$bar must not be unset in %s:7 +string(3) "bar" + +Fatal error: Uncaught TypeError: Typed property Foo::$bar must not be accessed before initialization in %s:14 Stack trace: #0 {main} - thrown in %s on line 7 + thrown in %s on line 14 diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 457e25f..5c4fb3e 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -520,6 +520,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_ zval tmp_member; zval *retval; uint32_t property_offset; + zend_property_info *prop_info = NULL; zobj = Z_OBJ_P(object); @@ -593,7 +594,11 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_ } } if ((type != BP_VAR_IS)) { - zend_error(E_NOTICE,"Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), Z_STRVAL_P(member)); + if (EXPECTED(!(zobj->ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) || + !(prop_info = zend_hash_find_ptr(&zobj->ce->properties_info, Z_STR_P(member))) || + !prop_info->type)) { + zend_error(E_NOTICE,"Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), Z_STRVAL_P(member)); + } } retval = &EG(uninitialized_zval); diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 2717781..b29d0c0 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -5988,19 +5988,6 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV) } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index ed8fecc..a7201a9 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -20148,19 +20148,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDL } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -24658,19 +24645,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER( } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -27280,19 +27254,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HAND } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -29668,19 +29629,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HA } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -33030,19 +32978,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDL } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -35463,19 +35398,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_H } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -41072,19 +40994,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLE } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -47583,19 +47492,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(Z } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -51205,19 +51101,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDL } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else {
diff --git a/Zend/tests/type_declarations/typed_properties_009.phpt b/Zend/tests/type_declarations/typed_properties_009.phpt index 5d74952..9c0b1ff 100644 --- a/Zend/tests/type_declarations/typed_properties_009.phpt +++ b/Zend/tests/type_declarations/typed_properties_009.phpt @@ -1,18 +1,27 @@ --TEST-- -Test typed properties disallow unset +Test typed properties unset leaves properties in an uninitialized state --FILE-- <?php class Foo { public int $bar; + + public function __get($name) { + var_dump($name); + } } $foo = new Foo(); + unset($foo->bar); + +var_dump($foo->bar); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Typed property Foo::$bar must not be unset in %s:7 +string(3) "bar" + +Fatal error: Uncaught TypeError: Typed property Foo::$bar must not be accessed before initialization in %s:14 Stack trace: #0 {main} - thrown in %s on line 7 + thrown in %s on line 14 diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 457e25f..5c4fb3e 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -520,6 +520,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_ zval tmp_member; zval *retval; uint32_t property_offset; + zend_property_info *prop_info = NULL; zobj = Z_OBJ_P(object); @@ -593,7 +594,11 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_ } } if ((type != BP_VAR_IS)) { - zend_error(E_NOTICE,"Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), Z_STRVAL_P(member)); + if (EXPECTED(!(zobj->ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) || + !(prop_info = zend_hash_find_ptr(&zobj->ce->properties_info, Z_STR_P(member))) || + !prop_info->type)) { + zend_error(E_NOTICE,"Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), Z_STRVAL_P(member)); + } } retval = &EG(uninitialized_zval); diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 2717781..b29d0c0 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -5988,19 +5988,6 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV) } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index ed8fecc..a7201a9 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -20148,19 +20148,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDL } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -24658,19 +24645,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER( } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -27280,19 +27254,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HAND } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -29668,19 +29629,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HA } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -33030,19 +32978,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDL } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -35463,19 +35398,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_H } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -41072,19 +40994,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLE } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -47583,19 +47492,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(Z } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else { @@ -51205,19 +51101,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDL } } - if (UNEXPECTED(Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS && Z_TYPE_P(offset) == IS_STRING)) { - /* TODO(krakjoe) needs caching */ - zend_property_info *prop_info = zend_hash_find_ptr(&Z_OBJCE_P(container)->properties_info, Z_STR_P(offset)); - - if (prop_info && prop_info->type) { - zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "Typed property %s::$%s must not be unset", - ZSTR_VAL(Z_OBJCE_P(container)->name), - Z_STRVAL_P(offset)); - HANDLE_EXCEPTION(); - } - } - if (Z_OBJ_HT_P(container)->unset_property) { Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL)); } else {