vincentas — 2012-12-05T09:04:27-05:00 — #1
I'm looking for PHP Optimization tips. Coding practices and other methodologies which will make my PHP execute faster.
One tip per answer, please, and include why it makes the code faster!
logic_earth — 2012-12-05T10:18:45-05:00 — #2
There are no optimization tips we can provided. Optimizing an application is depended on the application. In either case you need to profile your code. See: https://en.wikipedia.org/wiki/Profiling_(computer_programming)
After that, use your favorite search engine for resource concerning PHP and profiling.
tpunt — 2012-12-05T11:33:16-05:00 — #3
The best results for optimising your application are usually seen with well written code; so refactoring your PHP is a good place to start. A more generalised method would be to cache the opcode with the likes of APC (a PECL extension).