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()));

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
146.2 ms | 2026 KiB | 11 Q