Great list of tips / hacks for optimizing PHP for speed.    Here are a couple that caught my eye:

  1. $row[’id’] is 7 times faster than $row[id]
  2. Incrementing an undefined local variable is 9-10 times slower than a pre-initialized one.
  3. In some instance you can improve the speed of your code by using an isset() trick.
    Ex.
    if (strlen($foo) < 5) { echo “Foo is too short”; }
    vs.
    if (!isset($foo{5})) { echo “Foo is too short”; }

http://webguy.antaramedia.com/blog/?p=22

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]


Comments

  1. 1
    Julian
    October 16th, 2007 at 1:13 pm

Leave a Comment

You must be logged in to post a comment.

blank