Skip to content

Commit c70a828

Browse files
committed
Use DNF intersection type check also for simple intersection types
1 parent 9286101 commit c70a828

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Zend/zend_execute.c

+1-10
Original file line numberDiff line numberDiff line change
@@ -1066,16 +1066,7 @@ static zend_always_inline bool zend_check_type_slow(
10661066
if (UNEXPECTED(ZEND_TYPE_HAS_LIST(*type))) {
10671067
zend_type *list_type;
10681068
if (ZEND_TYPE_IS_INTERSECTION(*type)) {
1069-
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(*type), list_type) {
1070-
ce = zend_fetch_ce_from_cache_slot(cache_slot, list_type);
1071-
/* If type is not an instance of one of the types taking part in the
1072-
* intersection it cannot be a valid instance of the whole intersection type. */
1073-
if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce)) {
1074-
return false;
1075-
}
1076-
PROGRESS_CACHE_SLOT();
1077-
} ZEND_TYPE_LIST_FOREACH_END();
1078-
return true;
1069+
return zend_check_intersection_type_from_cache_slot(ZEND_TYPE_LIST(*type), Z_OBJCE_P(arg), &cache_slot);
10791070
} else {
10801071
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(*type), list_type) {
10811072
if (ZEND_TYPE_IS_INTERSECTION(*list_type)) {

0 commit comments

Comments
 (0)