]> granicus.if.org Git - php/commitdiff
Fix #79652 Ensure that the mixed type is displayed instead of the union of all types
authorMáté Kocsis <kocsismate@woohoolabs.com>
Fri, 29 May 2020 20:31:37 +0000 (22:31 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Sat, 30 May 2020 06:58:59 +0000 (08:58 +0200)
Closes GH-56430

Zend/zend_compile.c
ext/reflection/tests/mixed_type.phpt

index d8a54dbd44e56b51c79814e916231af85367f678..5dfa5f2a3d2e00c61bab306d36dbd518f9a9cda9 100644 (file)
@@ -1184,7 +1184,7 @@ zend_string *zend_type_to_string_resolved(zend_type type, zend_class_entry *scop
                str = zend_string_copy(ZEND_TYPE_CE(type)->name);
        }
 
-       uint32_t type_mask = ZEND_TYPE_FULL_MASK(type);
+       uint32_t type_mask = ZEND_TYPE_PURE_MASK(type);
 
        if (type_mask == MAY_BE_ANY) {
                str = add_type_string(str, ZSTR_KNOWN(ZEND_STR_MIXED));
index d44b91789cd3987d1716c0597898cb2c5d45e741..2860e603c1700e0da06cef8d54ae9435312e4f1a 100644 (file)
@@ -6,7 +6,7 @@ class A
 {
     public mixed $a;
 
-    public function test(mixed $a): mixed {}
+    public function test(mixed ...$a): mixed {}
 }
 
 $a = new A();