diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2016-06-05 09:49:29 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2016-06-05 22:06:17 -0500 |
commit | 277d89cde8ed19c0e1f9f51e14bcb993f80e1d22 (patch) | |
tree | a01a08d262784872375bde80dc597cfa5afd04b5 /Zend/zend_inheritance.c | |
parent | cf0290c27380e17d2407828c974882d39ed976f4 (diff) | |
download | php-git-277d89cde8ed19c0e1f9f51e14bcb993f80e1d22.tar.gz |
Limit covariance to array and Traversable
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r-- | Zend/zend_inheritance.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 1785f45372..6c3dc743fb 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -22,7 +22,6 @@ #include "zend_compile.h" #include "zend_execute.h" #include "zend_inheritance.h" -#include "zend_interfaces.h" #include "zend_smart_str.h" #include "zend_inheritance.h" @@ -170,19 +169,11 @@ char *zend_visibility_string(uint32_t fn_flags) /* {{{ */ static zend_bool zend_iterable_type_check(zend_arg_info *arg_info) /* {{{ */ { - if (arg_info->class_name) { - zend_class_entry *ce; - - ce = zend_lookup_class(arg_info->class_name); - - if (ce && instanceof_function(ce, zend_ce_traversable)) { - return 1; - } - - return 0; + if (arg_info->type_hint == IS_ITERABLE || arg_info->type_hint == IS_ARRAY) { + return 1; } - if (arg_info->type_hint == IS_ITERABLE || arg_info->type_hint == IS_ARRAY) { + if (arg_info->class_name && zend_string_equals_literal_ci(arg_info->class_name, "Traversable")) { return 1; } |