PHPBench was constructed as a way to open people’s eyes to the fact that not every PHP code snippet will run at the same speed. You may be surprised at the results PHPBench generates. It was also created so that you would be able to find discovery in these statistics and then maybe re-run these tests in your own server environment to play around with this idea yourself, by using the code examples. You can see some interesting conclusions from PHPBench as follow as well.
1. Surprising results show that if you implement sizeof() there is almost no difference in whether calculating the size of a loop in advance.
2. In reality the echo and print functions serve the exact purpose and therefore in the backend the exact same code applies. The one small thing to notice is that when using a comma to separate items whilst using the echo function, items run slightly faster.
3. The while loop 90% of the time is indeed slightly faster.
Requirements: -
Demo: http://www.phpbench.com/
License: License Free





PHP 基准测试…
原文:The PHP Benchmark | Web Resources | WebAppers。
创建 PHPBench 的目的是让你看到每一个 PHP 代码段的运行速度不都是一样的。看到 PHPBench 生成的结果,你很可能会大吃一惊。这个网站还有一个目…
[...] 原文:The PHP Benchmark | Web Resources | WebAppers。 [...]
RSS feed for comments on this post · TrackBack URI