December 28th, 2012, 01:23 PM
About Reflection API
Well I was wondering though, you can evaluate a class method or property in the following two possible ways:
$class = new ReflectionClass($class);
$method = $class->getMethod($method);
$property = $class->getProperty($property);
But which one is better? Is there a performance advantage/disadvantage between these two? Or is it really just a matter of preference?
$method = new ReflectionMethod($class, $method);
$property = new ReflectionProperty($class, $property);
December 28th, 2012, 01:42 PM
For all practical applications there is no performance difference between them. It doesn't matter which one you use.
December 28th, 2012, 01:44 PM
I see, so its just a matter of choice then? Thx the reply.
Originally Posted by E-Oreo