(PHP 7)
ReflectionParameter::hasType — Checks if parameter has a type
Checks if the parameter has a type associated with it.
Esta função não possui parâmetros.
TRUE
if a type is specified, FALSE
otherwise.
Exemplo #1 ReflectionParameter::hasType() example
<?php
function someFunction(string $param, $param2 = null) {}
$reflectionFunc = new ReflectionFunction('someFunction');
$reflectionParams = $reflectionFunc->getParameters();
var_dump($reflectionParams[0]->hasType());
var_dump($reflectionParams[1]->hasType());
O exemplo acima irá imprimir algo similar à:
bool(true) bool(false)