summaryrefslogtreecommitdiff
path: root/ext/spl/php_spl.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-03-18 22:44:02 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-03-23 18:59:04 +0100
commit01b266aac405c3c4c677d46f348dc6b227b69f7f (patch)
treed1c68e09fa5f200542b2424c084bc25bb2a5397f /ext/spl/php_spl.c
parentd7b73de8c9299ef1e7c55f22449dff3e0833f68e (diff)
downloadphp-git-01b266aac405c3c4c677d46f348dc6b227b69f7f.tar.gz
Improve error messages of various extensions
Closes GH-5278
Diffstat (limited to 'ext/spl/php_spl.c')
-rw-r--r--ext/spl/php_spl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 3fd3604072..9ccb9da3a5 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -93,7 +93,7 @@ PHP_FUNCTION(class_parents)
}
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
- zend_type_error("Object or string expected");
+ zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(obj));
RETURN_THROWS();
}
@@ -126,7 +126,7 @@ PHP_FUNCTION(class_implements)
RETURN_THROWS();
}
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
- zend_type_error("Object or string expected");
+ zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(obj));
RETURN_THROWS();
}
@@ -155,7 +155,7 @@ PHP_FUNCTION(class_uses)
RETURN_THROWS();
}
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
- zend_type_error("Object or string expected");
+ zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(obj));
RETURN_THROWS();
}