summaryrefslogtreecommitdiff
path: root/Zend/zend_builtin_functions.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-04-09 10:55:53 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-04-09 11:38:47 +0200
commite6458d67cfa54cdcd6d3c96897106fa8cb738414 (patch)
treefa3bbeb15695b49bb68cdcd30e738d809ad1a56f /Zend/zend_builtin_functions.c
parent12324364f7a9c839942cab08b05605cd6cc9e4b8 (diff)
downloadphp-git-e6458d67cfa54cdcd6d3c96897106fa8cb738414.tar.gz
Fix #79462: method_exists and property_exists incoherent behavior
Both functions are closely related, so should behave the same for wrong input types, i.e. both should throw a TypeError.
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r--Zend/zend_builtin_functions.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 3b0e05c212..4753e9b7c1 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1107,7 +1107,8 @@ ZEND_FUNCTION(method_exists)
RETURN_FALSE;
}
} else {
- RETURN_FALSE;
+ zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(klass));
+ RETURN_THROWS();
}
lcname = zend_string_tolower(method_name);