summaryrefslogtreecommitdiff
path: root/Zend/zend_inheritance.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-11-24 10:09:28 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-11-24 10:09:28 +0100
commit912cb8b8b52f958ac6eb482466c01e99fc0c0e35 (patch)
tree3a05ce27449415bf19709f7a4caf0807f8af071d /Zend/zend_inheritance.c
parent4bbb98c24fa691c176e403ab00a2fe3dd4224b3e (diff)
downloadphp-git-912cb8b8b52f958ac6eb482466c01e99fc0c0e35.tar.gz
Fixed bug #80391
Iterable was not considered a subtype of array|object, and thus also not a subtype of mixed.
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r--Zend/zend_inheritance.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 7401456d8f..882738b758 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -323,6 +323,10 @@ static zend_bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce
static zend_bool zend_type_contains_traversable(zend_type type) {
zend_type *single_type;
+ if (ZEND_TYPE_FULL_MASK(type) & MAY_BE_OBJECT) {
+ return 1;
+ }
+
ZEND_TYPE_FOREACH(type, single_type) {
if (ZEND_TYPE_HAS_NAME(*single_type)
&& zend_string_equals_literal_ci(ZEND_TYPE_NAME(*single_type), "Traversable")) {