Skip to content

ovr/phpreflection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Reflection

Build Status

Function reflection

You can get function reflection by using getFunction from $reflector:

$reflector = new Reflector(Reflector::manuallyFactory());
$reflection = $reflector->getFunction('gettype');

Next you can use methods from FunctionReflection, for example:

var_dump($reflection->getNumberOfParameters());
var_dump($reflection->getNumberOfRequiredParameters());

At all, you can run function from $reflection

var_dump($reflection->run(array(1))); //float