getParameters(); foreach($rps as $rp) { var_dump($rp->getTypeText()); } var_dump($rf->getReturnTypeText()); } function printClass($rc) { $rms = $rc->getMethods(); $meths = array(); foreach($rms as $rm) { $meths[$rm->getName()] = $rm; } ksort($meths); foreach($meths as $meth) { printFunc($meth); } $rps = $rc->getProperties(); $props = array(); foreach($rps as $rp) { $props[$rp->getName()] = $rp; } ksort($props); foreach($props as $prop) { var_dump($prop->getTypeText()); } } function f() { } $rf = new ReflectionFunction('f'); printFunc($rf); function f1(int $t) { } $rf = new ReflectionFunction('f1'); printFunc($rf); function f2(@string $s) { } $rf = new ReflectionFunction('f2'); printFunc($rf); function f3(?:xhp:hello $x) { } $rf = new ReflectionFunction('f3'); printFunc($rf); function f100(): int { } $rf = new ReflectionFunction('f100'); printFunc($rf); function f101(): string { } $rf = new ReflectionFunction('f101'); printFunc($rf); function f102(): Vector<:xhp:element> { } $rf = new ReflectionFunction('f102'); printFunc($rf); function f200((string, Template, ?int, Vector>) $tuple): ?int { } $rf = new ReflectionFunction('f200'); printFunc($rf); function f201((function (@int, Map>>):Vector) $i): ClassA { } $rf = new ReflectionFunction('f201'); printFunc($rf); function f202(:xhp:html-element $html): Map> { } $rf = new ReflectionFunction('f202'); printFunc($rf); function f203((int, Vector) $tupple): array { } $rf = new ReflectionFunction('f203'); printFunc($rf); function f204((function (int): Vector) $f): array { } $rf = new ReflectionFunction('f204'); printFunc($rf); function f300(Y $y, ?double $d): X { } $rf = new ReflectionFunction('f300'); printFunc($rf); function f301((function (): Vector) $f): array { } $rf = new ReflectionFunction('f301'); printFunc($rf); function f302((Y, X, double, string) $f): ?Y { } $rf = new ReflectionFunction('f302'); printFunc($rf); class C { public @int $a; public ?string $b; public Vector $v; public (string, (function(?int, (string, string)):void)) $c; public function __construct(?int $i, (int, string) $c) { } static public function m1() { } public function m2(@double $d) : void { } static public function m3(Vector>> $v, :xhp:html $x) : @array> { } public function m4((function(@int, (string, string)): void) $v) : array> { } } $rc = new ReflectionClass('C'); printClass($rc); class CT { public @int $a; public ?string $b; public Vector $v; public (string, (function(?int, (X, Y)):void)) $c; public function __construct(?int $i, (int, X) $c) { } static public function m1() { } public function m2(@Y $d) : void { } static public function m3(Vector>> $v, :xhp:html $x) : @array> { } public function m4((function(@int, (X, string)): void) $v) : array> { } } $rc = new ReflectionClass('CT'); printClass($rc); trait T { static public function m1() { } public function m2(@int $d) : void { } static public function m3(Vector>> $v, :xhp:html $x) : @array> { } public function m4((function(@int, (double, string)): void) $v) : array, :xhp:html>> { } } class TC { use T; } $rc = new ReflectionClass('TC'); printClass($rc); function ff(Vector $i, ?string $s, @C $c, array $a) { } $rf = new ReflectionFunction('ff'); $rps = $rf->getParameters(); foreach ($rps as $rp) { var_dump($rp->getTypeText()); if ($rp->getClass() != null) { var_dump($rp->getClass()->getName()); } else { var_dump(""); } }