<?php
class Some
{
public function method(int $int, callable $callback, array $array, \stdClass $class)
{
}
}
$function = new ReflectionMethod('Some', 'method');
foreach ($function->getParameters() as $parameter) {
var_dump($parameter->getType()->isBuiltin(), (string)$parameter->getType());
}
Deprecated: Function ReflectionType::__toString() is deprecated in /in/lbpek on line 19
bool(true)
string(3) "int"
Deprecated: Function ReflectionType::__toString() is deprecated in /in/lbpek on line 19
bool(true)
string(8) "callable"
Deprecated: Function ReflectionType::__toString() is deprecated in /in/lbpek on line 19
bool(true)
string(5) "array"
Deprecated: Function ReflectionType::__toString() is deprecated in /in/lbpek on line 19
bool(false)
string(8) "stdClass"