@@ -1005,18 +1005,9 @@ static zend_always_inline bool zend_check_type_slow(
1005
1005
} else {
1006
1006
ZEND_TYPE_LIST_FOREACH (ZEND_TYPE_LIST (* type ), list_type ) {
1007
1007
ce = zend_fetch_ce_from_cache_slot (cache_slot , list_type );
1008
- /* If we cannot resolve the CE we cannot check if it satisfies
1009
- * the type constraint, check the next one. */
1010
- if (ce == NULL ) {
1011
- if (HAVE_CACHE_SLOT ) {
1012
- cache_slot ++ ;
1013
- }
1014
- continue ;
1015
- }
1016
-
1017
- /* Perform actual type check */
1008
+ /* Perform actual type check if we have a CE */
1018
1009
/* Instance of a single type part of a union is sufficient to pass the type check */
1019
- if (instanceof_function (Z_OBJCE_P (arg ), ce )) {
1010
+ if (ce && instanceof_function (Z_OBJCE_P (arg ), ce )) {
1020
1011
return true;
1021
1012
}
1022
1013
if (HAVE_CACHE_SLOT ) {
@@ -1026,19 +1017,14 @@ static zend_always_inline bool zend_check_type_slow(
1026
1017
}
1027
1018
} else {
1028
1019
ce = zend_fetch_ce_from_cache_slot (cache_slot , type );
1029
- /* If we cannot resolve the CE we cannot check if it satisfies
1030
- * the type constraint, check if a standard type satisfies it. */
1031
- if (ce == NULL ) {
1032
- goto builtin_types ;
1033
- }
1034
-
1035
- if (instanceof_function (Z_OBJCE_P (arg ), ce )) {
1036
- return 1 ;
1020
+ /* If we have a CE we check if it satisfies the type constraint,
1021
+ * otherwise it will check if a standard type satisfies it. */
1022
+ if (ce && instanceof_function (Z_OBJCE_P (arg ), ce )) {
1023
+ return true;
1037
1024
}
1038
1025
}
1039
1026
}
1040
1027
1041
- builtin_types :
1042
1028
type_mask = ZEND_TYPE_FULL_MASK (* type );
1043
1029
if ((type_mask & MAY_BE_CALLABLE ) && zend_is_callable (arg , 0 , NULL )) {
1044
1030
return 1 ;
0 commit comments