com php-src: more words in error message: Zend/tests/type_dec larations/typed_properties_004.phpt Zend/tests/ty
pe_declarations/typed_properties_005.phpt Zend/ zend_vm_def.h Zend/zend_vm_execute.h

From: Date: Mon, 07 Mar 2016 06:59:36 +0000
Subject: com php-src: more words in error message: Zend/tests/type_dec larations/typed_properties_004.phpt Zend/tests/ty
pe_declarations/typed_properties_005.phpt Zend/ zend_vm_def.h Zend/zend_vm_execute.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95629@lists.php.net to get a copy of this message
Commit: bd4368c2f3667ec76fc0eeadcf6613fdcba7672f Author: Joe Watkins <krakjoe@php.net> Mon, 7 Mar 2016 06:59:36 +0000 Parents: 52b184ed8a9c3c48dfec9e73ee890976c3846693 Branches: typed_ref_properties Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bd4368c2f3667ec76fc0eeadcf6613fdcba7672f Log: more words in error message Changed paths: M Zend/tests/type_declarations/typed_properties_004.phpt M Zend/tests/type_declarations/typed_properties_005.phpt M Zend/zend_vm_def.h M Zend/zend_vm_execute.h

diff --git a/Zend/tests/type_declarations/typed_properties_004.phpt b/Zend/tests/type_declarations/typed_properties_004.phpt index 4678066..b56f773 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 in %s:6 +Fatal error: Uncaught TypeError: 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 1b2d7f4..2193247 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 in %s:8 +Fatal error: Uncaught TypeError: 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/zend_vm_def.h b/Zend/zend_vm_def.h index d0c1baa..b7cb592 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2306,25 +2306,26 @@ ZEND_VM_C_LABEL(fast_assign_obj): /* TODO(krakjoe) needs a cache slot */ zend_class_entry *ce = zend_lookup_class(prop_info->type_name); - /* TODO(krakjoe) check instanceof is sound */ if (Z_TYPE_P(value) != IS_OBJECT || !instanceof_function(ce, Z_OBJCE_P(value))) { - - /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", - ZSTR_VAL(prop_info->ce->name), + "%s::$%s must be an instance of %s, %s used", + ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { - - /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", - ZSTR_VAL(prop_info->ce->name), + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 1946bed..9c8fabf 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -17940,20 +17940,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -18149,20 +18155,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -18358,20 +18370,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -18567,20 +18585,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -22483,20 +22507,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -22692,20 +22722,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -22901,20 +22937,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -23110,20 +23152,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -25221,20 +25269,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -25430,20 +25484,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -25639,20 +25699,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -25848,20 +25914,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -27816,20 +27888,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -28025,20 +28103,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -28234,20 +28318,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -28443,20 +28533,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -31307,20 +31403,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -31516,20 +31618,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -31725,20 +31833,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -31934,20 +32048,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -33741,20 +33861,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -33950,20 +34076,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -34159,20 +34291,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -34368,20 +34506,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -38795,20 +38939,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -39004,20 +39154,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -39213,20 +39369,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -39422,20 +39584,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -45305,20 +45473,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -45514,20 +45688,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -45723,20 +45903,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -45932,20 +46118,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -49030,20 +49222,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -49239,20 +49437,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -49448,20 +49652,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } @@ -49657,20 +49867,26 @@ fast_assign_obj: /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be an instance of %s", + "%s::$%s must be an instance of %s, %s used", ZSTR_VAL(prop_info->ce->name), Z_STRVAL_P(property_name), - ZSTR_VAL(prop_info->type_name)); + ZSTR_VAL(prop_info->type_name), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } } else if (!ZEND_SAME_FAKE_TYPE(prop_info->type, Z_TYPE_P(value))) { /* TODO(krakjoe) check wording of error message */ zend_throw_exception_ex(zend_ce_type_error, prop_info->type, - "%s::$%s must be %s", + "%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)); + zend_get_type_by_const(prop_info->type), + Z_TYPE_P(value) == IS_OBJECT ? + ZSTR_VAL(Z_OBJCE_P(value)->name) : + zend_get_type_by_const(Z_TYPE_P(value))); HANDLE_EXCEPTION(); } }
« previous php.cvs (#95629) next »