Jan 24
Reflection
Reflection No Comments »Reflection was introduced in PHP 5 to inspect and to retrieve information and reverse-engineer classes, interfaces, functions and methods as well as extensions during runtime.
Snippets:
How to create an instance of a class using reflection in PHP:
// this code does the same as: $instance = new ClassName();
$class = new ReflectionClass("ClassName");
if ($class->isInstantiable())
$instance = $class->newInstance();




Recent Comments