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(): null {}, 15 function(): false {}, 16 function(): true {}, 17 function(): StdClass {} 18]; 19 20foreach ($functions as $function) { 21 $reflectionFunc = new ReflectionFunction($function); 22 $returnType = $reflectionFunc->getReturnType(); 23 var_dump($returnType->getName()); 24} 25?> 26--EXPECT-- 27string(4) "void" 28string(3) "int" 29string(5) "float" 30string(6) "string" 31string(4) "bool" 32string(5) "array" 33string(8) "callable" 34string(4) "null" 35string(5) "false" 36string(4) "true" 37string(8) "StdClass" 38