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.
This commit is contained in:
Nikita Popov 2021-03-18 15:15:21 +01:00
parent c8a8c47f7e
commit 4df39f4bd0
5 changed files with 17 additions and 20 deletions

View file

@ -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;
}