com php-src: better error messages: Zend/tests/type_declarati ons/typed_properties_002.phpt Zend/tests/type_d eclarations/typed_properties_003.phpt
Zend/tests/ type_declarations/typed_properties_004.phpt Zen d/tests/type_declarations/typed_properties_005.ph pt
Zend/tests/type_declarations/typed_properties_00 9.phpt Zend/tests/type_declarations/typed_properties _010.phpt Zend/tests/type_declarations/typed_pr
operties_011.phpt Zend/tests/type_declarations/
| From: | Bob Weinand | Date: | Tue, 08 Mar 2016 07:56:29 +0000 |
| Subject: | com php-src: better error messages: Zend/tests/type_declarati ons/typed_properties_002.phpt Zend/tests/type_d eclarations/typed_properties_003.phpt Zend/tests/ type_declarations/typed_properties_004.phpt Zen d/tests/type_declarations/typed_properties_005.ph pt Zend/tests/type_declarations/typed_properties_00 9.phpt Zend/tests/type_declarations/typed_properties _010.phpt Zend/tests/type_declarations/typed_pr operties_011.phpt Zend/tests/type_declarations/ |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95611@lists.php.net to get a copy of this message | ||
Commit: ce473721d5fa5b91c83319a14ca7e99242b29ffe
Author: Joe Watkins <krakjoe@php.net> Tue, 8 Mar 2016 07:56:29 +0000
Parents: f7f8c1b62397c3206a82e302ddd26ebc995e5155
Branches: typed_ref_properties
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ce473721d5fa5b91c83319a14ca7e99242b29ffe
Log:
better error messages
Changed paths:
M Zend/tests/type_declarations/typed_properties_002.phpt
M Zend/tests/type_declarations/typed_properties_003.phpt
M Zend/tests/type_declarations/typed_properties_004.phpt
M Zend/tests/type_declarations/typed_properties_005.phpt
M Zend/tests/type_declarations/typed_properties_009.phpt
M Zend/tests/type_declarations/typed_properties_010.phpt
M Zend/tests/type_declarations/typed_properties_011.phpt
M Zend/tests/type_declarations/typed_properties_012.phpt
M Zend/tests/type_declarations/typed_properties_013.phpt
M Zend/tests/type_declarations/typed_properties_014.phpt
M Zend/tests/type_declarations/typed_properties_015.phpt
M Zend/zend_API.c
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
diff --git a/Zend/tests/type_declarations/typed_properties_002.phpt b/Zend/tests/type_declarations/typed_properties_002.phpt index a046d79..facaee0 100644 --- a/Zend/tests/type_declarations/typed_properties_002.phpt +++ b/Zend/tests/type_declarations/typed_properties_002.phpt @@ -9,7 +9,7 @@ $thing = new class() { var_dump($thing->int); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: class@anonymous::$int accessed before initialization in %s:6 +Fatal error: Uncaught TypeError: Typed property class@anonymous::$int must not be accessed before initialization in %s:6 Stack trace: #0 {main} thrown in %s on line 6 diff --git a/Zend/tests/type_declarations/typed_properties_003.phpt b/Zend/tests/type_declarations/typed_properties_003.phpt index b2743a9..36337b3 100644 --- a/Zend/tests/type_declarations/typed_properties_003.phpt +++ b/Zend/tests/type_declarations/typed_properties_003.phpt @@ -9,7 +9,7 @@ $thing = new class() { $var = &$thing->int; ?> --EXPECTF-- -Fatal error: Uncaught TypeError: fetching reference to class@anonymous::$int is disallowed in %s:6 +Fatal error: Uncaught TypeError: Typed property class@anonymous::$int must not be referenced in %s:6 Stack trace: #0 {main} thrown in %s on line 6 diff --git a/Zend/tests/type_declarations/typed_properties_004.phpt b/Zend/tests/type_declarations/typed_properties_004.phpt index b56f773..59314ab 100644 --- a/Zend/tests/type_declarations/typed_properties_004.phpt +++ b/Zend/tests/type_declarations/typed_properties_004.phpt @@ -11,7 +11,7 @@ new class("PHP 7 is better than you, and it knows it ...") { }; ?> --EXPECTF-- -Fatal error: Uncaught TypeError: class@anonymous::$int must be integer, string used in %s:6 +Fatal error: Uncaught TypeError: Typed property class@anonymous::$int must be integer, string used in %s:6 Stack trace: #0 %s(2): class@anonymous->__construct('PHP 7 is better...') #1 {main} diff --git a/Zend/tests/type_declarations/typed_properties_005.phpt b/Zend/tests/type_declarations/typed_properties_005.phpt index 2193247..05de225 100644 --- a/Zend/tests/type_declarations/typed_properties_005.phpt +++ b/Zend/tests/type_declarations/typed_properties_005.phpt @@ -13,7 +13,7 @@ new class(new Dummy) { }; ?> --EXPECTF-- -Fatal error: Uncaught TypeError: class@anonymous::$std must be an instance of stdClass, Dummy used in %s:8 +Fatal error: Uncaught TypeError: Typed property class@anonymous::$std must be an instance of stdClass, Dummy used in %s:8 Stack trace: #0 %s(4): class@anonymous->__construct(Object(Dummy)) #1 {main} diff --git a/Zend/tests/type_declarations/typed_properties_009.phpt b/Zend/tests/type_declarations/typed_properties_009.phpt index 75c3521..caa435a 100644 --- a/Zend/tests/type_declarations/typed_properties_009.phpt +++ b/Zend/tests/type_declarations/typed_properties_009.phpt @@ -10,7 +10,7 @@ $foo = new Foo(); unset($foo->bar); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Foo::$bar must not be unset in %s:7 +Fatal error: Uncaught TypeError: Typed property Foo::$bar must not be unset in %s:7 Stack trace: #0 {main} thrown in %s on line 7 diff --git a/Zend/tests/type_declarations/typed_properties_010.phpt b/Zend/tests/type_declarations/typed_properties_010.phpt index 8506792..c11e928 100644 --- a/Zend/tests/type_declarations/typed_properties_010.phpt +++ b/Zend/tests/type_declarations/typed_properties_010.phpt @@ -14,7 +14,7 @@ $foo = new Foo(); $cb($foo->bar); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: fetching reference to Foo::$bar is disallowed in %s:11 +Fatal error: Uncaught TypeError: Typed property Foo::$bar must not be referenced in %s:11 Stack trace: #0 {main} thrown in %s on line 11 diff --git a/Zend/tests/type_declarations/typed_properties_011.phpt b/Zend/tests/type_declarations/typed_properties_011.phpt index ed9db44..d958ec2 100644 --- a/Zend/tests/type_declarations/typed_properties_011.phpt +++ b/Zend/tests/type_declarations/typed_properties_011.phpt @@ -11,7 +11,7 @@ $foo = new Foo(); $array = [&$foo->bar]; ?> --EXPECTF-- -Fatal error: Uncaught TypeError: fetching reference to Foo::$bar is disallowed in %s:8 +Fatal error: Uncaught TypeError: Typed property Foo::$bar must not be referenced in %s:8 Stack trace: #0 {main} thrown in %s on line 8 diff --git a/Zend/tests/type_declarations/typed_properties_012.phpt b/Zend/tests/type_declarations/typed_properties_012.phpt index 47122ab..d3a1f84 100644 --- a/Zend/tests/type_declarations/typed_properties_012.phpt +++ b/Zend/tests/type_declarations/typed_properties_012.phpt @@ -10,7 +10,7 @@ $foo = new Foo(); foreach ($foo as &$prop); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: foreach by reference over Foo is disallowed in %s:7 +Fatal error: Uncaught TypeError: Typed properties exist in Foo: foreach by reference is disallowed in %s:7 Stack trace: #0 {main} thrown in %s on line 7 diff --git a/Zend/tests/type_declarations/typed_properties_013.phpt b/Zend/tests/type_declarations/typed_properties_013.phpt index 1bf8a62..499ed85 100644 --- a/Zend/tests/type_declarations/typed_properties_013.phpt +++ b/Zend/tests/type_declarations/typed_properties_013.phpt @@ -7,7 +7,7 @@ class Foo { } ?> --EXPECTF-- -Fatal error: Type of Foo::$bar must be integer, float used in %s on line 3 +Fatal error: Typed property Foo::$bar must be integer, float used in %s on line 3 diff --git a/Zend/tests/type_declarations/typed_properties_014.phpt b/Zend/tests/type_declarations/typed_properties_014.phpt index c9fb163..af9d5c5 100644 --- a/Zend/tests/type_declarations/typed_properties_014.phpt +++ b/Zend/tests/type_declarations/typed_properties_014.phpt @@ -7,7 +7,7 @@ class Foo { } ?> --EXPECTF-- -Fatal error: Type of Foo::$bar must be array, null used in %s on line 3 +Fatal error: Typed property Foo::$bar must be array, null used in %s on line 3 diff --git a/Zend/tests/type_declarations/typed_properties_015.phpt b/Zend/tests/type_declarations/typed_properties_015.phpt index 3a1fb8f..15643ca 100644 --- a/Zend/tests/type_declarations/typed_properties_015.phpt +++ b/Zend/tests/type_declarations/typed_properties_015.phpt @@ -7,7 +7,7 @@ class Foo { } ?> --EXPECTF-- -Fatal error: Type of Foo::$bar must be stdClass, null used in %s on line 3 +Fatal error: Typed property Foo::$bar must be stdClass, null used in %s on line 3 diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 5350aba..2450fcd 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3623,50 +3623,34 @@ ZEND_API int zend_declare_typed_property(zend_class_entry *ce, zend_string *name } if (optional_type) { - if (optional_type == IS_OBJECT) { - if (Z_TYPE_P(property) != IS_UNDEF) { + if (Z_TYPE_P(property) != IS_UNDEF) { + if (optional_type == IS_OBJECT) { zend_string *type_name = optional_type_name; - - if (zend_string_equals_literal_ci(type_name, "parent")) { - if (!ce->parent) { - zend_error(E_COMPILE_ERROR, - "Type of %s::$%s cannot be parent type, no parent scope active", - ZSTR_VAL(ce->name), - ZSTR_VAL(name)); - return FAILURE; - } - - type_name = ce->parent->name; - } - + if (zend_string_equals_literal_ci(type_name, "self")) { type_name = ce->name; } - zend_error(E_COMPILE_ERROR, - "Type of %s::$%s must be %s, %s used", + zend_error(E_COMPILE_ERROR, + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(ce->name), ZSTR_VAL(name), ZSTR_VAL(type_name), - Z_TYPE_P(property) == IS_OBJECT ? - ZSTR_VAL(Z_OBJCE_P(property)->name) : - zend_get_type_by_const(Z_TYPE_P(property))); + zend_get_type_by_const(Z_TYPE_P(property))); return FAILURE; - } - } else if (Z_TYPE_P(property) != IS_UNDEF && !ZEND_SAME_FAKE_TYPE(optional_type, Z_TYPE_P(property))) { - zend_error(E_COMPILE_ERROR, - "Type of %s::$%s must be %s, %s used", - ZSTR_VAL(ce->name), - ZSTR_VAL(name), - zend_get_type_by_const(optional_type), - Z_TYPE_P(property) == IS_OBJECT ? - ZSTR_VAL(Z_OBJCE_P(property)->name) : + } else if(!ZEND_SAME_FAKE_TYPE(optional_type, Z_TYPE_P(property))) { + zend_error(E_COMPILE_ERROR, + "Typed property %s::$%s must be %s, %s used", + ZSTR_VAL(ce->name), + ZSTR_VAL(name), + zend_get_type_by_const(optional_type), zend_get_type_by_const(Z_TYPE_P(property))); - return FAILURE; + return FAILURE; + } } } - if (Z_TYPE_P(property) == IS_UNDEF) { + if (Z_ISUNDEF_P(property)) { ZVAL_NULL(property); } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 7a05623..fdcb323 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1867,7 +1867,7 @@ ZEND_VM_C_LABEL(fetch_obj_r_no_object): if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -1909,7 +1909,7 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV) if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -2058,7 +2058,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|THIS|CV, CONST if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -2099,7 +2099,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV) if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -2329,7 +2329,7 @@ ZEND_VM_C_LABEL(fast_assign_obj): if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -2340,7 +2340,7 @@ ZEND_VM_C_LABEL(fast_assign_obj): } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -5952,7 +5952,7 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV) if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -6138,7 +6138,7 @@ ZEND_VM_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR) if (Z_OBJCE_P(array_ptr)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_throw_exception_ex( zend_ce_type_error, 0, - "foreach by reference over %s is disallowed", + "Typed properties exist in %s: foreach by reference is disallowed", ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); HANDLE_EXCEPTION(); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 13e20f5..f594a7b 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4266,7 +4266,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CONST_HANDLER if (Z_OBJCE_P(array_ptr)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_throw_exception_ex( zend_ce_type_error, 0, - "foreach by reference over %s is disallowed", + "Typed properties exist in %s: foreach by reference is disallowed", ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); HANDLE_EXCEPTION(); } @@ -5622,7 +5622,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -5741,7 +5741,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -9402,7 +9402,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -9521,7 +9521,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -11234,7 +11234,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -11354,7 +11354,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -12677,7 +12677,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z if (Z_OBJCE_P(array_ptr)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_throw_exception_ex( zend_ce_type_error, 0, - "foreach by reference over %s is disallowed", + "Typed properties exist in %s: foreach by reference is disallowed", ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); HANDLE_EXCEPTION(); } @@ -13187,7 +13187,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -13234,7 +13234,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CO if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -14443,7 +14443,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -14490,7 +14490,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -15000,7 +15000,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -15047,7 +15047,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TM if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -16272,7 +16272,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z if (Z_OBJCE_P(array_ptr)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_throw_exception_ex( zend_ce_type_error, 0, - "foreach by reference over %s is disallowed", + "Typed properties exist in %s: foreach by reference is disallowed", ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); HANDLE_EXCEPTION(); } @@ -17727,7 +17727,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -17758,6 +17758,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HAN HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -17768,7 +17769,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HAN if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -17844,7 +17845,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CO if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -17885,7 +17886,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -18071,7 +18072,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -18082,7 +18083,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -18282,7 +18283,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -18293,7 +18294,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -18493,7 +18494,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -18504,7 +18505,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -18704,7 +18705,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -18715,7 +18716,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -19666,7 +19667,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDL if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -22298,7 +22299,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -22329,6 +22330,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLE HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -22339,7 +22341,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLE if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -22415,7 +22417,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -22456,7 +22458,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HA if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -22642,7 +22644,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -22653,7 +22655,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -22853,7 +22855,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -22864,7 +22866,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -23064,7 +23066,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -23075,7 +23077,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -23275,7 +23277,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -23286,7 +23288,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -24210,7 +24212,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER( if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -25064,7 +25066,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -25095,6 +25097,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HA HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -25105,7 +25108,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HA if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -25181,7 +25184,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TM if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -25222,7 +25225,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVA if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -25408,7 +25411,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -25419,7 +25422,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -25619,7 +25622,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -25630,7 +25633,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -25830,7 +25833,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -25841,7 +25844,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -26041,7 +26044,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -26052,7 +26055,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -26866,7 +26869,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HAND if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -27615,7 +27618,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -27646,6 +27649,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_ HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -27656,7 +27660,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_ if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -27804,7 +27808,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -27845,7 +27849,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CO if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -28031,7 +28035,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -28042,7 +28046,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -28242,7 +28246,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -28253,7 +28257,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -28453,7 +28457,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -28464,7 +28468,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -28664,7 +28668,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -28675,7 +28679,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -29288,7 +29292,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HA if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -31134,7 +31138,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -31165,6 +31169,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HAN HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -31175,7 +31180,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HAN if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -31323,7 +31328,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -31364,7 +31369,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -31550,7 +31555,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -31561,7 +31566,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -31761,7 +31766,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -31772,7 +31777,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -31972,7 +31977,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -31983,7 +31988,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -32183,7 +32188,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -32194,7 +32199,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -32681,7 +32686,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDL if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -33595,7 +33600,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -33626,6 +33631,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -33636,7 +33642,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -33785,7 +33791,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -33826,7 +33832,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TM if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -34012,7 +34018,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -34023,7 +34029,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -34223,7 +34229,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -34234,7 +34240,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -34434,7 +34440,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -34445,7 +34451,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -34645,7 +34651,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -34656,7 +34662,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -35145,7 +35151,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_H if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -36723,7 +36729,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE if (Z_OBJCE_P(array_ptr)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_throw_exception_ex( zend_ce_type_error, 0, - "foreach by reference over %s is disallowed", + "Typed properties exist in %s: foreach by reference is disallowed", ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); HANDLE_EXCEPTION(); } @@ -38642,7 +38648,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -38673,6 +38679,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HAND HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -38683,7 +38690,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HAND if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -38831,7 +38838,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CON if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -38872,7 +38879,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_ if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -39102,7 +39109,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -39113,7 +39120,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -39313,7 +39320,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -39324,7 +39331,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -39524,7 +39531,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -39535,7 +39542,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -39735,7 +39742,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -39746,7 +39753,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -40777,7 +40784,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLE if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -45224,7 +45231,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -45255,6 +45262,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -45265,7 +45273,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -45413,7 +45421,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_ if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -45454,7 +45462,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HAN if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -45640,7 +45648,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -45651,7 +45659,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -45851,7 +45859,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -45862,7 +45870,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -46062,7 +46070,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -46073,7 +46081,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -46273,7 +46281,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -46284,7 +46292,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -47311,7 +47319,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(Z if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -48976,7 +48984,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -49007,6 +49015,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HAN HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -49017,7 +49026,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HAN if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -49166,7 +49175,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -49207,7 +49216,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -49393,7 +49402,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -49404,7 +49413,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -49604,7 +49613,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -49615,7 +49624,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -49815,7 +49824,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -49826,7 +49835,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -50026,7 +50035,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -50037,7 +50046,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -50956,7 +50965,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDL if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION();
diff --git a/Zend/tests/type_declarations/typed_properties_002.phpt b/Zend/tests/type_declarations/typed_properties_002.phpt index a046d79..facaee0 100644 --- a/Zend/tests/type_declarations/typed_properties_002.phpt +++ b/Zend/tests/type_declarations/typed_properties_002.phpt @@ -9,7 +9,7 @@ $thing = new class() { var_dump($thing->int); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: class@anonymous::$int accessed before initialization in %s:6 +Fatal error: Uncaught TypeError: Typed property class@anonymous::$int must not be accessed before initialization in %s:6 Stack trace: #0 {main} thrown in %s on line 6 diff --git a/Zend/tests/type_declarations/typed_properties_003.phpt b/Zend/tests/type_declarations/typed_properties_003.phpt index b2743a9..36337b3 100644 --- a/Zend/tests/type_declarations/typed_properties_003.phpt +++ b/Zend/tests/type_declarations/typed_properties_003.phpt @@ -9,7 +9,7 @@ $thing = new class() { $var = &$thing->int; ?> --EXPECTF-- -Fatal error: Uncaught TypeError: fetching reference to class@anonymous::$int is disallowed in %s:6 +Fatal error: Uncaught TypeError: Typed property class@anonymous::$int must not be referenced in %s:6 Stack trace: #0 {main} thrown in %s on line 6 diff --git a/Zend/tests/type_declarations/typed_properties_004.phpt b/Zend/tests/type_declarations/typed_properties_004.phpt index b56f773..59314ab 100644 --- a/Zend/tests/type_declarations/typed_properties_004.phpt +++ b/Zend/tests/type_declarations/typed_properties_004.phpt @@ -11,7 +11,7 @@ new class("PHP 7 is better than you, and it knows it ...") { }; ?> --EXPECTF-- -Fatal error: Uncaught TypeError: class@anonymous::$int must be integer, string used in %s:6 +Fatal error: Uncaught TypeError: Typed property class@anonymous::$int must be integer, string used in %s:6 Stack trace: #0 %s(2): class@anonymous->__construct('PHP 7 is better...') #1 {main} diff --git a/Zend/tests/type_declarations/typed_properties_005.phpt b/Zend/tests/type_declarations/typed_properties_005.phpt index 2193247..05de225 100644 --- a/Zend/tests/type_declarations/typed_properties_005.phpt +++ b/Zend/tests/type_declarations/typed_properties_005.phpt @@ -13,7 +13,7 @@ new class(new Dummy) { }; ?> --EXPECTF-- -Fatal error: Uncaught TypeError: class@anonymous::$std must be an instance of stdClass, Dummy used in %s:8 +Fatal error: Uncaught TypeError: Typed property class@anonymous::$std must be an instance of stdClass, Dummy used in %s:8 Stack trace: #0 %s(4): class@anonymous->__construct(Object(Dummy)) #1 {main} diff --git a/Zend/tests/type_declarations/typed_properties_009.phpt b/Zend/tests/type_declarations/typed_properties_009.phpt index 75c3521..caa435a 100644 --- a/Zend/tests/type_declarations/typed_properties_009.phpt +++ b/Zend/tests/type_declarations/typed_properties_009.phpt @@ -10,7 +10,7 @@ $foo = new Foo(); unset($foo->bar); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Foo::$bar must not be unset in %s:7 +Fatal error: Uncaught TypeError: Typed property Foo::$bar must not be unset in %s:7 Stack trace: #0 {main} thrown in %s on line 7 diff --git a/Zend/tests/type_declarations/typed_properties_010.phpt b/Zend/tests/type_declarations/typed_properties_010.phpt index 8506792..c11e928 100644 --- a/Zend/tests/type_declarations/typed_properties_010.phpt +++ b/Zend/tests/type_declarations/typed_properties_010.phpt @@ -14,7 +14,7 @@ $foo = new Foo(); $cb($foo->bar); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: fetching reference to Foo::$bar is disallowed in %s:11 +Fatal error: Uncaught TypeError: Typed property Foo::$bar must not be referenced in %s:11 Stack trace: #0 {main} thrown in %s on line 11 diff --git a/Zend/tests/type_declarations/typed_properties_011.phpt b/Zend/tests/type_declarations/typed_properties_011.phpt index ed9db44..d958ec2 100644 --- a/Zend/tests/type_declarations/typed_properties_011.phpt +++ b/Zend/tests/type_declarations/typed_properties_011.phpt @@ -11,7 +11,7 @@ $foo = new Foo(); $array = [&$foo->bar]; ?> --EXPECTF-- -Fatal error: Uncaught TypeError: fetching reference to Foo::$bar is disallowed in %s:8 +Fatal error: Uncaught TypeError: Typed property Foo::$bar must not be referenced in %s:8 Stack trace: #0 {main} thrown in %s on line 8 diff --git a/Zend/tests/type_declarations/typed_properties_012.phpt b/Zend/tests/type_declarations/typed_properties_012.phpt index 47122ab..d3a1f84 100644 --- a/Zend/tests/type_declarations/typed_properties_012.phpt +++ b/Zend/tests/type_declarations/typed_properties_012.phpt @@ -10,7 +10,7 @@ $foo = new Foo(); foreach ($foo as &$prop); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: foreach by reference over Foo is disallowed in %s:7 +Fatal error: Uncaught TypeError: Typed properties exist in Foo: foreach by reference is disallowed in %s:7 Stack trace: #0 {main} thrown in %s on line 7 diff --git a/Zend/tests/type_declarations/typed_properties_013.phpt b/Zend/tests/type_declarations/typed_properties_013.phpt index 1bf8a62..499ed85 100644 --- a/Zend/tests/type_declarations/typed_properties_013.phpt +++ b/Zend/tests/type_declarations/typed_properties_013.phpt @@ -7,7 +7,7 @@ class Foo { } ?> --EXPECTF-- -Fatal error: Type of Foo::$bar must be integer, float used in %s on line 3 +Fatal error: Typed property Foo::$bar must be integer, float used in %s on line 3 diff --git a/Zend/tests/type_declarations/typed_properties_014.phpt b/Zend/tests/type_declarations/typed_properties_014.phpt index c9fb163..af9d5c5 100644 --- a/Zend/tests/type_declarations/typed_properties_014.phpt +++ b/Zend/tests/type_declarations/typed_properties_014.phpt @@ -7,7 +7,7 @@ class Foo { } ?> --EXPECTF-- -Fatal error: Type of Foo::$bar must be array, null used in %s on line 3 +Fatal error: Typed property Foo::$bar must be array, null used in %s on line 3 diff --git a/Zend/tests/type_declarations/typed_properties_015.phpt b/Zend/tests/type_declarations/typed_properties_015.phpt index 3a1fb8f..15643ca 100644 --- a/Zend/tests/type_declarations/typed_properties_015.phpt +++ b/Zend/tests/type_declarations/typed_properties_015.phpt @@ -7,7 +7,7 @@ class Foo { } ?> --EXPECTF-- -Fatal error: Type of Foo::$bar must be stdClass, null used in %s on line 3 +Fatal error: Typed property Foo::$bar must be stdClass, null used in %s on line 3 diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 5350aba..2450fcd 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3623,50 +3623,34 @@ ZEND_API int zend_declare_typed_property(zend_class_entry *ce, zend_string *name } if (optional_type) { - if (optional_type == IS_OBJECT) { - if (Z_TYPE_P(property) != IS_UNDEF) { + if (Z_TYPE_P(property) != IS_UNDEF) { + if (optional_type == IS_OBJECT) { zend_string *type_name = optional_type_name; - - if (zend_string_equals_literal_ci(type_name, "parent")) { - if (!ce->parent) { - zend_error(E_COMPILE_ERROR, - "Type of %s::$%s cannot be parent type, no parent scope active", - ZSTR_VAL(ce->name), - ZSTR_VAL(name)); - return FAILURE; - } - - type_name = ce->parent->name; - } - + if (zend_string_equals_literal_ci(type_name, "self")) { type_name = ce->name; } - zend_error(E_COMPILE_ERROR, - "Type of %s::$%s must be %s, %s used", + zend_error(E_COMPILE_ERROR, + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(ce->name), ZSTR_VAL(name), ZSTR_VAL(type_name), - Z_TYPE_P(property) == IS_OBJECT ? - ZSTR_VAL(Z_OBJCE_P(property)->name) : - zend_get_type_by_const(Z_TYPE_P(property))); + zend_get_type_by_const(Z_TYPE_P(property))); return FAILURE; - } - } else if (Z_TYPE_P(property) != IS_UNDEF && !ZEND_SAME_FAKE_TYPE(optional_type, Z_TYPE_P(property))) { - zend_error(E_COMPILE_ERROR, - "Type of %s::$%s must be %s, %s used", - ZSTR_VAL(ce->name), - ZSTR_VAL(name), - zend_get_type_by_const(optional_type), - Z_TYPE_P(property) == IS_OBJECT ? - ZSTR_VAL(Z_OBJCE_P(property)->name) : + } else if(!ZEND_SAME_FAKE_TYPE(optional_type, Z_TYPE_P(property))) { + zend_error(E_COMPILE_ERROR, + "Typed property %s::$%s must be %s, %s used", + ZSTR_VAL(ce->name), + ZSTR_VAL(name), + zend_get_type_by_const(optional_type), zend_get_type_by_const(Z_TYPE_P(property))); - return FAILURE; + return FAILURE; + } } } - if (Z_TYPE_P(property) == IS_UNDEF) { + if (Z_ISUNDEF_P(property)) { ZVAL_NULL(property); } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 7a05623..fdcb323 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1867,7 +1867,7 @@ ZEND_VM_C_LABEL(fetch_obj_r_no_object): if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -1909,7 +1909,7 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV) if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -2058,7 +2058,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|THIS|CV, CONST if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -2099,7 +2099,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV) if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -2329,7 +2329,7 @@ ZEND_VM_C_LABEL(fast_assign_obj): if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -2340,7 +2340,7 @@ ZEND_VM_C_LABEL(fast_assign_obj): } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -5952,7 +5952,7 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV) if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -6138,7 +6138,7 @@ ZEND_VM_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR) if (Z_OBJCE_P(array_ptr)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_throw_exception_ex( zend_ce_type_error, 0, - "foreach by reference over %s is disallowed", + "Typed properties exist in %s: foreach by reference is disallowed", ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); HANDLE_EXCEPTION(); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 13e20f5..f594a7b 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4266,7 +4266,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CONST_HANDLER if (Z_OBJCE_P(array_ptr)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_throw_exception_ex( zend_ce_type_error, 0, - "foreach by reference over %s is disallowed", + "Typed properties exist in %s: foreach by reference is disallowed", ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); HANDLE_EXCEPTION(); } @@ -5622,7 +5622,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -5741,7 +5741,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -9402,7 +9402,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -9521,7 +9521,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -11234,7 +11234,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -11354,7 +11354,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_ if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -12677,7 +12677,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z if (Z_OBJCE_P(array_ptr)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_throw_exception_ex( zend_ce_type_error, 0, - "foreach by reference over %s is disallowed", + "Typed properties exist in %s: foreach by reference is disallowed", ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); HANDLE_EXCEPTION(); } @@ -13187,7 +13187,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -13234,7 +13234,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CO if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -14443,7 +14443,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -14490,7 +14490,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CV if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -15000,7 +15000,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -15047,7 +15047,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_TM if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -16272,7 +16272,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z if (Z_OBJCE_P(array_ptr)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_throw_exception_ex( zend_ce_type_error, 0, - "foreach by reference over %s is disallowed", + "Typed properties exist in %s: foreach by reference is disallowed", ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); HANDLE_EXCEPTION(); } @@ -17727,7 +17727,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -17758,6 +17758,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HAN HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -17768,7 +17769,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HAN if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -17844,7 +17845,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CO if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -17885,7 +17886,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -18071,7 +18072,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -18082,7 +18083,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -18282,7 +18283,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -18293,7 +18294,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -18493,7 +18494,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -18504,7 +18505,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -18704,7 +18705,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -18715,7 +18716,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -19666,7 +19667,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDL if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -22298,7 +22299,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -22329,6 +22330,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLE HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -22339,7 +22341,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLE if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -22415,7 +22417,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -22456,7 +22458,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HA if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -22642,7 +22644,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -22653,7 +22655,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -22853,7 +22855,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -22864,7 +22866,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -23064,7 +23066,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -23075,7 +23077,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -23275,7 +23277,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -23286,7 +23288,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -24210,7 +24212,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER( if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -25064,7 +25066,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -25095,6 +25097,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HA HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -25105,7 +25108,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HA if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -25181,7 +25184,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TM if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -25222,7 +25225,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVA if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -25408,7 +25411,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -25419,7 +25422,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -25619,7 +25622,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -25630,7 +25633,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -25830,7 +25833,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -25841,7 +25844,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -26041,7 +26044,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -26052,7 +26055,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -26866,7 +26869,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HAND if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -27615,7 +27618,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -27646,6 +27649,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_ HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -27656,7 +27660,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_ if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -27804,7 +27808,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -27845,7 +27849,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CO if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -28031,7 +28035,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -28042,7 +28046,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -28242,7 +28246,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -28253,7 +28257,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -28453,7 +28457,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -28464,7 +28468,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -28664,7 +28668,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -28675,7 +28679,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -29288,7 +29292,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HA if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -31134,7 +31138,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -31165,6 +31169,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HAN HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -31175,7 +31180,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HAN if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -31323,7 +31328,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -31364,7 +31369,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -31550,7 +31555,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -31561,7 +31566,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -31761,7 +31766,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -31772,7 +31777,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -31972,7 +31977,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -31983,7 +31988,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -32183,7 +32188,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -32194,7 +32199,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -32681,7 +32686,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDL if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -33595,7 +33600,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -33626,6 +33631,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -33636,7 +33642,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -33785,7 +33791,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -33826,7 +33832,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TM if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -34012,7 +34018,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -34023,7 +34029,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -34223,7 +34229,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -34234,7 +34240,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -34434,7 +34440,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -34445,7 +34451,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -34645,7 +34651,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -34656,7 +34662,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -35145,7 +35151,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_H if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -36723,7 +36729,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE if (Z_OBJCE_P(array_ptr)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_throw_exception_ex( zend_ce_type_error, 0, - "foreach by reference over %s is disallowed", + "Typed properties exist in %s: foreach by reference is disallowed", ZSTR_VAL(Z_OBJCE_P(array_ptr)->name)); HANDLE_EXCEPTION(); } @@ -38642,7 +38648,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -38673,6 +38679,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HAND HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -38683,7 +38690,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HAND if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -38831,7 +38838,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CON if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -38872,7 +38879,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_ if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -39102,7 +39109,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -39113,7 +39120,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -39313,7 +39320,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -39324,7 +39331,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -39524,7 +39531,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -39535,7 +39542,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -39735,7 +39742,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -39746,7 +39753,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -40777,7 +40784,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLE if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -45224,7 +45231,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -45255,6 +45262,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -45265,7 +45273,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -45413,7 +45421,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_ if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -45454,7 +45462,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HAN if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -45640,7 +45648,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -45651,7 +45659,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -45851,7 +45859,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -45862,7 +45870,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -46062,7 +46070,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -46073,7 +46081,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -46273,7 +46281,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -46284,7 +46292,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -47311,7 +47319,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(Z if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -48976,7 +48984,7 @@ fetch_obj_r_no_object: if (prop_info && prop_info->type && Z_TYPE_P(EX_VAR(opline->result.var)) != prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s accessed before initialization", + "Typed property %s::$%s must not be accessed before initialization", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION(); @@ -49007,6 +49015,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HAN HANDLE_EXCEPTION(); } + /* TODO(krakjoe) deref container ? */ if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT && Z_OBJCE_P(container)->ce_flags & ZEND_ACC_HAS_TYPE_HINTS)) { if (EX(opline) + 1 < &EX(func)->op_array.opcodes[EX(func)->op_array.last]) { switch ((EX(opline) + 1)->opcode) { @@ -49017,7 +49026,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HAN if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -49166,7 +49175,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP if (prop_info && prop_info->type) { zend_throw_exception_ex( zend_ce_type_error, prop_info->type, - "fetching reference to %s::$%s is disallowed", + "Typed property %s::$%s must not be referenced", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); } @@ -49207,7 +49216,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(property)); HANDLE_EXCEPTION(); @@ -49393,7 +49402,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -49404,7 +49413,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -49604,7 +49613,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -49615,7 +49624,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -49815,7 +49824,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -49826,7 +49835,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -50026,7 +50035,7 @@ fast_assign_obj: if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s, %s used", + "Typed property %s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), ZSTR_VAL(zend_resolve_property_type(prop_info)), @@ -50037,7 +50046,7 @@ fast_assign_obj: } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s, %s used", + "Typed property %s::$%s must be %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), zend_get_type_by_const(prop_info->type), @@ -50956,7 +50965,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDL if (prop_info && prop_info->type) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must not be unset", + "Typed property %s::$%s must not be unset", ZSTR_VAL(Z_OBJCE_P(container)->name), Z_STRVAL_P(offset)); HANDLE_EXCEPTION();