- var_dump: documentation ( source)
<?php
class A {
public function foo(PDO $foo = null, array $bar, int $x = 0) {
}
}
$method = new ReflectionMethod(A::class, "foo");
$params = $method->getParameters();
foreach ($params as $param) {
$type = $param->getType();
var_dump($type->isBuiltin(), $type->allowsNull(), (empty($type) ? "" : $type . " ") . $param->name);
print PHP_EOL . PHP_EOL;
}