Last Updated: January 23, 2020
·
693
· mathewparet

5 Steps to speed up your PHP pages

  1. sprintf is much faster than using variables in double quotes
  2. PHP5 has introduced $_SERVER[’REQUEST_TIME’] which has the script execution start time. So you can avoid using microtime() or time() functions.
  3. When parsing with XML in PHP try xml2array. This function uses the PHP XML functions. So it would be better than calling specific functions for each data.
  4. else if is much faster than case/switch
  5. echo for a faster print

2 Responses
Add your response

I would say the above mentioned has a very small effect on overall performance. What about things like Xcache and eAccelerator?

over 1 year ago ·

And our old friend "micro optimization" is back. This reminds me of "use single quotes instead of double quotes to speed things up".

over 1 year ago ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Related Tags
#php
#speed
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside