3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getClass(ReflectionType $type) { if ($type instanceof ReflectionNamedType) { if (!in_array($type->getName(), ['array', /* further predefined types */], true)) { return $type->getName(); } } return null; } function foo(array $array) {} $rf = new ReflectionFunction('foo'); $rp = $rf->getParameters()[0]; var_dump(isClass($rp->getType()));

preferences:
112.21 ms | 1394 KiB | 5 Q