1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 12:13:02 +02:00

Do manual type checks because the engine doesn't

This commit is contained in:
Sara Golemon
2022-06-01 16:27:47 +00:00
parent 7c28196a8a
commit e7817ec3b2

View File

@@ -334,13 +334,15 @@ static ZEND_FUNCTION(zend_call_method)
if (Z_TYPE_P(class_or_object) == IS_OBJECT) {
obj = Z_OBJ_P(class_or_object);
ce = obj->ce;
} else {
ZEND_ASSERT(Z_TYPE_P(class_or_object) == IS_STRING);
} else if (Z_TYPE_P(class_or_object) == IS_STRING) {
ce = zend_lookup_class(Z_STR_P(class_or_object));
if (!ce) {
zend_error(E_ERROR, "Unknown class '%s'", Z_STRVAL_P(class_or_object));
return;
}
} else {
zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(class_or_object));
return;
}
ZEND_ASSERT((argc >= 2) && (argc <= 4));