@@ -1424,28 +1424,14 @@ zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *
1424
1424
if (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD ) {
1425
1425
return zend_lookup_class_ex (class_name , key , 0 );
1426
1426
} else if ((ce = zend_lookup_class_ex (class_name , key , 1 )) == NULL ) {
1427
- if (fetch_type & ZEND_FETCH_CLASS_SILENT ) {
1428
- return NULL ;
1429
- }
1430
- if (EG (exception )) {
1431
- if (!(fetch_type & ZEND_FETCH_CLASS_EXCEPTION )) {
1432
- zend_string * exception_str ;
1433
- zval exception_zv ;
1434
- ZVAL_OBJ (& exception_zv , EG (exception ));
1435
- Z_ADDREF (exception_zv );
1436
- zend_clear_exception ();
1437
- exception_str = zval_get_string (& exception_zv );
1438
- zend_error_noreturn (E_ERROR ,
1439
- "During class fetch: Uncaught %s" , ZSTR_VAL (exception_str ));
1427
+ if ((fetch_type & ZEND_FETCH_CLASS_SILENT ) == 0 && !EG (exception )) {
1428
+ if ((fetch_type & ZEND_FETCH_CLASS_MASK ) == ZEND_FETCH_CLASS_INTERFACE ) {
1429
+ zend_throw_or_error (fetch_type , NULL , "Interface '%s' not found" , ZSTR_VAL (class_name ));
1430
+ } else if ((fetch_type & ZEND_FETCH_CLASS_MASK ) == ZEND_FETCH_CLASS_TRAIT ) {
1431
+ zend_throw_or_error (fetch_type , NULL , "Trait '%s' not found" , ZSTR_VAL (class_name ));
1432
+ } else {
1433
+ zend_throw_or_error (fetch_type , NULL , "Class '%s' not found" , ZSTR_VAL (class_name ));
1440
1434
}
1441
- return NULL ;
1442
- }
1443
- if ((fetch_type & ZEND_FETCH_CLASS_MASK ) == ZEND_FETCH_CLASS_INTERFACE ) {
1444
- zend_throw_or_error (fetch_type , NULL , "Interface '%s' not found" , ZSTR_VAL (class_name ));
1445
- } else if ((fetch_type & ZEND_FETCH_CLASS_MASK ) == ZEND_FETCH_CLASS_TRAIT ) {
1446
- zend_throw_or_error (fetch_type , NULL , "Trait '%s' not found" , ZSTR_VAL (class_name ));
1447
- } else {
1448
- zend_throw_or_error (fetch_type , NULL , "Class '%s' not found" , ZSTR_VAL (class_name ));
1449
1435
}
1450
1436
return NULL ;
1451
1437
}
0 commit comments