Khanh Hoang - Kenn
Kenn is a user experience designer and front end developer who enjoys creating beautiful and usable web and mobile experiences.
Today i am searching solutions for any tips and tricks about best practice to optimize PHP code performances and i found some of useful articles which you may interested with.
One of them is an old post by Reinhold Webber, a good list of consideration practice in optimizing PHP code performances.
Here are Webber’s points:
1.if (strlen($foo) < 5) { echo "Foo is too short"; }
vs.
1.if (!isset($foo{5})) { echo "Foo is too short"; }
Calling isset() happens to be faster then strlen() because unlike strlen(), isset() is a language construct and not a function meaning that it’s execution does not require function lookups and lowercase. This means you have virtually no overhead on top of the actual code that determines the string’s length.
As Reihold Webber pointed to a post from John Lim (found this article copied without state the sourcehere), then i investigate further and truly that is an excellent best practice tutorial for optimizing the php code performance, covered almost all aspects from low level webserver configuration, PHP configuration, coding styling, and performace comparisson as well.
Another good practice for better php performance as written in cluesheet.com are: