3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace MyNamespace; class MyClass { function foo(iterable $iterable, array $array, int $int) { } } $reflection = new \ReflectionMethod(MyClass::class, 'foo'); $parameters = $reflection->getParameters(); echo (string) $parameters[0]->getType(), PHP_EOL; echo (string) $parameters[1]->getType(), PHP_EOL; echo (string) $parameters[2]->getType(), PHP_EOL;
based on XmNOl
Output for 7.1.0 - 7.2.6
iterable array int
Output for hhvm-3.15.4, 7.0.0 - 7.0.20
MyNamespace\iterable array int
Output for 5.6.0 - 5.6.30
Fatal error: Call to undefined method ReflectionParameter::getType() in /in/quhbu on line 13
Process exited with code 255.