diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-09 11:05:18 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-09 11:05:18 +0200 |
commit | 825f47564a77c447e03b6009ac5522b3382a48cb (patch) | |
tree | 867382c53eaca3e2006f3d3c0c73388a9e2eb2db /Zend/zend_execute_API.c | |
parent | 7404d756e99ebe31ddc685adf209a3eaf5081676 (diff) | |
parent | 22ed362810c1b3a5ecb54ebd1d50d804c7fc3159 (diff) | |
download | php-git-825f47564a77c447e03b6009ac5522b3382a48cb.tar.gz |
Merge branch 'PHP-7.2' into PHP-7.3
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r-- | Zend/zend_execute_API.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index aba82196ad..a551449e79 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1359,28 +1359,14 @@ zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval * if (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) { return zend_lookup_class_ex(class_name, key, 0); } else if ((ce = zend_lookup_class_ex(class_name, key, 1)) == NULL) { - if (fetch_type & ZEND_FETCH_CLASS_SILENT) { - return NULL; - } - if (EG(exception)) { - if (!(fetch_type & ZEND_FETCH_CLASS_EXCEPTION)) { - zend_string *exception_str; - zval exception_zv; - ZVAL_OBJ(&exception_zv, EG(exception)); - Z_ADDREF(exception_zv); - zend_clear_exception(); - exception_str = zval_get_string(&exception_zv); - zend_error_noreturn(E_ERROR, - "During class fetch: Uncaught %s", ZSTR_VAL(exception_str)); + if ((fetch_type & ZEND_FETCH_CLASS_SILENT) == 0 && !EG(exception)) { + if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) { + zend_throw_or_error(fetch_type, NULL, "Interface '%s' not found", ZSTR_VAL(class_name)); + } else if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_TRAIT) { + zend_throw_or_error(fetch_type, NULL, "Trait '%s' not found", ZSTR_VAL(class_name)); + } else { + zend_throw_or_error(fetch_type, NULL, "Class '%s' not found", ZSTR_VAL(class_name)); } - return NULL; - } - if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) { - zend_throw_or_error(fetch_type, NULL, "Interface '%s' not found", ZSTR_VAL(class_name)); - } else if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_TRAIT) { - zend_throw_or_error(fetch_type, NULL, "Trait '%s' not found", ZSTR_VAL(class_name)); - } else { - zend_throw_or_error(fetch_type, NULL, "Class '%s' not found", ZSTR_VAL(class_name)); } return NULL; } |