diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-18 15:15:21 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-18 15:15:21 +0100 |
commit | 4df39f4bd093ac70bb6582eb6dbaf29f45a8c1fd (patch) | |
tree | aca4c5c3a7a3bc2f37c42e192a42957dd1918688 /Zend/zend_execute_API.c | |
parent | c8a8c47f7eef7ef2a5853f2b6733e4114e72cbd0 (diff) | |
download | php-git-4df39f4bd093ac70bb6582eb6dbaf29f45a8c1fd.tar.gz |
Don't imply SILENT from NO_AUTOLOAD
We have separate flags for non-autoloading class fetches and
silent class fetches. There's no reason why NO_AUTOLOAD should
be special-cased to be implicitly silent.
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r-- | Zend/zend_execute_API.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index ce51ef7960..af3c8cc670 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1523,9 +1523,8 @@ check_fetch_type: break; } - if (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) { - return zend_lookup_class_ex(class_name, NULL, fetch_type); - } else if ((ce = zend_lookup_class_ex(class_name, NULL, fetch_type)) == NULL) { + ce = zend_lookup_class_ex(class_name, NULL, fetch_type); + if (!ce) { if (!(fetch_type & ZEND_FETCH_CLASS_SILENT) && !EG(exception)) { if (fetch_sub_type == ZEND_FETCH_CLASS_INTERFACE) { zend_throw_or_error(fetch_type, NULL, "Interface \"%s\" not found", ZSTR_VAL(class_name)); @@ -1543,11 +1542,8 @@ check_fetch_type: zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, zend_string *key, int fetch_type) /* {{{ */ { - zend_class_entry *ce; - - if (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) { - return zend_lookup_class_ex(class_name, key, fetch_type); - } else if ((ce = zend_lookup_class_ex(class_name, key, fetch_type)) == NULL) { + zend_class_entry *ce = zend_lookup_class_ex(class_name, key, fetch_type); + if (!ce) { if (fetch_type & ZEND_FETCH_CLASS_SILENT) { return NULL; } |