PHP 5 has a complete reflection API that adds the ability to reverse engineer classes, interfaces, functions, methods, and extensions. In addition, the reflection API provides a way to remove document comments from functions, classes, and methods.
Use of reflection in the TP frame:
Public reflectionclass::__construct (mixed $argument)
public object Reflectionclass::newinstanceargs ([array $args])
/** * Invoke reflection Execution Class instantiation support Dependency Injection * @access public * @param string $class class name * @param array $vars parameter * @return Mixed */Public function Invokeclass ($class, $vars = []) { try {$reflect = new Reflectionclass ($class); $constructor = $reflect->getconstructor (); Injection $args = $constructor used to support dependencies? $this->bindparams ($constructor, $vars): []; Return $reflect->newinstanceargs ($args); } catch (Reflectionexception $e) {throw new ClassNotFoundException (' Class NOT exists: '. $class, $class); } }