summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-02-05 10:07:07 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-03-11 11:32:20 +0100
commit513b76794bfa210edfdc5b478dffbcbb19747ad0 (patch)
tree6283beb92e0fd6a9da3e76c0f8ebe9649632f0aa /Zend/zend_execute.c
parent87f8b1b7097ff58c3a535f5ce085f46960b37b78 (diff)
downloadphp-git-513b76794bfa210edfdc5b478dffbcbb19747ad0.tar.gz
Make zpp failures always throw, independent of strict_types
Previously zend_parse_parameters (and FastZPP) would handle invalid arguments depending on strict_types: With strict_types=1, a TypeError is thrown, with strict_types=0 a warning is thrown and (usually) NULL is returned. Additionally, some functions (constructors always and other methods sometimes) opt-it to throwing regardless of strict_types. This commit changes zpp to always generate a TypeError exception in PHP 8.
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 1dc9fe97fb..fb19a1ac91 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -2535,7 +2535,7 @@ static zend_never_inline uint32_t ZEND_FASTCALL zend_array_key_exists_slow(zval
if (UNEXPECTED(Z_TYPE_INFO_P(subject) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP2();
}
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "array_key_exists() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(subject)));
+ zend_type_error("array_key_exists() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(subject)));
return IS_NULL;
}
}