jeudi 14 juin 2018

Reflection in php5 or php7

How to do reflection in php5 and get more infos about variables types ?

$reflector = new ReflectionMethod(new MyClass(),'methodName');
$params = $reflector->getParameters();

foreach( $params as $key=>$value):
  //-want to get something like $value->type
  echo $value->name;
endforeach;





Aucun commentaire:

Enregistrer un commentaire