3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { function foobar(int $int, string $string, array $array, callable $callable, Test $object, $noType) { } } $r = new ReflectionMethod('Test', 'foobar'); foreach ($r->getParameters() as $param) { var_dump(array($param->name, $param->hasType(), $param->getType())); }
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> string(3) "int" [1]=> bool(true) [2]=> object(ReflectionNamedType)#8 (0) { } } array(3) { [0]=> string(6) "string" [1]=> bool(true) [2]=> object(ReflectionNamedType)#8 (0) { } } array(3) { [0]=> string(5) "array" [1]=> bool(true) [2]=> object(ReflectionNamedType)#8 (0) { } } array(3) { [0]=> string(8) "callable" [1]=> bool(true) [2]=> object(ReflectionNamedType)#8 (0) { } } array(3) { [0]=> string(6) "object" [1]=> bool(true) [2]=> object(ReflectionNamedType)#8 (0) { } } array(3) { [0]=> string(6) "noType" [1]=> bool(false) [2]=> NULL }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
25.86 ms | 407 KiB | 5 Q