1--TEST-- 2Verify that variadic arguments create proper stub 3--EXTENSIONS-- 4zend_test 5--FILE-- 6<?php 7 8$reflection = new ReflectionMethod("_ZendTestClass", "variadicTest"); 9$arguments = $reflection->getParameters(); 10 11echo (string) $arguments[0], "\n"; 12var_dump($arguments[0]->isVariadic()); 13 14$type = $arguments[0]->getType(); 15 16var_dump($type instanceof ReflectionUnionType); 17 18echo "\n"; 19 20$types = $type->getTypes(); 21 22var_dump($types[0]->getName()); 23var_dump($types[0] instanceof ReflectionNamedType); 24var_dump($types[0]->allowsNull()); 25 26echo "\n"; 27 28var_dump($types[1]->getName()); 29var_dump($types[1] instanceof ReflectionNamedType); 30var_dump($types[1]->allowsNull()); 31 32?> 33--EXPECTF-- 34Parameter #0 [ <optional> Iterator|string ...$elements ] 35bool(true) 36bool(true) 37 38string(8) "Iterator" 39bool(true) 40bool(false) 41 42string(6) "string" 43bool(true) 44bool(false) 45