1--TEST-- 2ReflectionType possible types 3--FILE-- 4<?php 5 6$functions = [ 7 function(): void {}, 8 function(): int {}, 9 function(): float {}, 10 function(): string {}, 11 function(): bool {}, 12 function(): array {}, 13 function(): callable {}, 14 function(): iterable {}, 15 function(): StdClass {} 16]; 17 18foreach ($functions as $function) { 19 $reflectionFunc = new ReflectionFunction($function); 20 $returnType = $reflectionFunc->getReturnType(); 21 var_dump($returnType->getName()); 22} 23?> 24--EXPECT-- 25string(4) "void" 26string(3) "int" 27string(5) "float" 28string(6) "string" 29string(4) "bool" 30string(5) "array" 31string(8) "callable" 32string(8) "iterable" 33string(8) "StdClass" 34