summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-03-27 23:39:49 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-05-22 16:08:12 +0200
commitaec4c0fd031ad557527ff6c888a1b60048bb1cdc (patch)
tree2f437957be3862d543c45a2db6c4e5e44f9ff1df /ext/reflection/php_reflection.c
parent4bc1d8333aa8b40a6c6fe89762f6b5a4bd309a1c (diff)
downloadphp-git-aec4c0fd031ad557527ff6c888a1b60048bb1cdc.tar.gz
Add support for the mixed type
RFC: https://wiki.php.net/rfc/mixed_type_v2 Closes GH-5313 Co-authored-by: Dan Ackroyd <danack@basereality.com>
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 1ed057d902..9aac065e38 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1187,13 +1187,13 @@ static void reflection_type_factory(zend_type type, zval *object, zend_bool lega
reflection_object *intern;
type_reference *reference;
zend_bool is_union = is_union_type(type);
+ zend_bool is_mixed = ZEND_TYPE_PURE_MASK(type) == MAY_BE_ANY;
- reflection_instantiate(
- is_union ? reflection_union_type_ptr : reflection_named_type_ptr, object);
+ reflection_instantiate(is_union && !is_mixed ? reflection_union_type_ptr : reflection_named_type_ptr, object);
intern = Z_REFLECTION_P(object);
reference = (type_reference*) emalloc(sizeof(type_reference));
reference->type = type;
- reference->legacy_behavior = legacy_behavior && !is_union;
+ reference->legacy_behavior = legacy_behavior && !is_union && !is_mixed;
intern->ptr = reference;
intern->ref_type = REF_TYPE_TYPE;