Apparently, this point was fixed in later versions of PHP (5.5.12).
I ran the OP code (with empty methods) and I get the following results:
Static Time: 1.0153820514679 ms Object Time: 1.100515127182 ms
Edit: eight months and a few releases later ...
It is interesting to see how Zend and the community are actively working on PHP performance.
π PHP 5.6
Here are the same tests with PHP 5.6.9 (ZE 2.6):
Static Time: 0.97488021850586 ms Object Time: 1.0362110137939 ms Function Time: 0.96977496147156 ms
For one run, βobject timeβ was even faster than static time, so now they are very close. Better, we can see that objects are almost fast as functions!
π PHP 7.0
I also compiled PHP 7.0 alpha 1 (ZE 3.0), and it's amazing to see how fast a language such as PHP (compared to other dynamic languages, as you can see here or here ) can be optimized over and over again:
Static Time: 0.33447790145874 ms Object Time: 0.30291485786438 ms Function Time: 0.2329089641571 ms
With PHP7, the main functions have been greatly optimized, and the "static time" is again slower than the "instance / object time".
Edit, October 2015 a year later: PHP 7.0 RC5 . Now "static time" is faster. It is important to note: a scalar type hint (a new function in PHP7) brings significant overhead, it is about 16% slower (the type of hint does not make your code 16% slower, it's slower when you code only consists of function calls;) In real applications it is insignificant). Such overhead may seem counterintuitive, but it is less unexpected when you know that dynamic typing is at the core of PHP. Unlike other more static languages, the hint type in PHP means more checks for the Zend Engine, and no less than some of us can expect. In the future, we are likely to get more optimizations at runtime (just like analyzing the HHVM runtime code and the JiT approach). Keep in mind that PHP7 is young, and all the cleanup that has been done for this release will improve features and performance in the future.
π HHVM
The test against HHVM 3.7.1 still shows that HHVM easily wins in such tests, here you can see the advantages of compiling JiT (JiT is a "planned" function for future versions of PHP, we will probably get it in branches 7.x or 8.x. Zend created PoC as an extension to OpCache ):
Static Time: 0.070882797241211 ms Object Time: 0.23940300941467 ms Function Time: 0.06760311126709 ms
For HHVM, functions and static methods have very similar synchronization, this may allow us to think that they are almost the same inside (after all, a static method is very similar to a function with names). Instance instance is "catastrophic" compared to others. This shows how the HHVM and ZE are very different engines.
Conclusion
There is no guarantee that one of these methods (static / instance) will stay faster forever. Use what seems best from a software development point of view and keep consistent code in an existing application.
If you have a choice and / or if you are writing a library, etc., perhaps you can use instance methods that are more friendly to DI environments, and this gives more control to the developer who consumes your API.
If you just provide utility functions (for example, these small packages in the npm ecosystem), you can use functions with names (but keep in mind that PHP still doesnβt work; there is an autoload function , which means that Composer cannot be lazy loading your library , as is the case with PSR-0/4)