File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1042,11 +1042,14 @@ static bool zend_check_intersection_type_from_cache_slot(zend_type_list *interse
1042
1042
zend_type * list_type ;
1043
1043
bool status = true;
1044
1044
ZEND_TYPE_LIST_FOREACH (intersection_type_list , list_type ) {
1045
- ce = zend_fetch_ce_from_cache_slot (cache_slot , list_type );
1046
- /* If type is not an instance of one of the types taking part in the
1047
- * intersection it cannot be a valid instance of the whole intersection type. */
1048
- if (!ce || !instanceof_function (arg_ce , ce )) {
1049
- status = false;
1045
+ /* Only check classes if the type might be valid */
1046
+ if (status ) {
1047
+ ce = zend_fetch_ce_from_cache_slot (cache_slot , list_type );
1048
+ /* If type is not an instance of one of the types taking part in the
1049
+ * intersection it cannot be a valid instance of the whole intersection type. */
1050
+ if (!ce || !instanceof_function (arg_ce , ce )) {
1051
+ status = false;
1052
+ }
1050
1053
}
1051
1054
PROGRESS_CACHE_SLOT ();
1052
1055
} ZEND_TYPE_LIST_FOREACH_END ();
You can’t perform that action at this time.
0 commit comments