I\'m currently considering the use of Reflection classes (ReflectionClass and ReflectionMethod mainly) in my own MVC web framework, because I need to automatically instancia
Calling a static function 1 million times will cost ~ 0.31 seconds on my machine. When using a ReflectionMethod, it costs ~ 1.82 seconds. That means it is ~ 500% more expensive to use the Reflection API.
This is the code I used by the way:
invokeArgs(null, array('f'));
}
echo ($b=microtime(true) - $s)."\n";
echo 100/$a*$b;
Obviously, the actual impact depends on the number of calls you expect to do