3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php     $START = time();     $foo['bar'] = "test";     for ($i = 0; $i < 10000000; ++$i) {         if ($foo['bar'] == "test") {             $j = 0;         }     }     $END = time() - $START;     print "Array took $END seconds\n";     $START = time();     $testvar = $foo['bar'];     for ($i = 0; $i < 10000000; ++$i) {         if ($testvar == "test") {             $j = 0;         }    }    $END = time() - $START;    print "Var took $END seconds\n";?>
based on aA2jY
Output for 5.4.0 - 5.4.31
Parse error: syntax error, unexpected '$START ' (T_VARIABLE) in /in/A5Xof on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.29
<?php     $START = time();     $foo['bar'] = "test";     for ($i = 0; $i < 10000000; ++$i) {         if ($foo['bar'] == "test") {             $j = 0;         }     }     $END = time() - $START;     print "Array took $END seconds\n";     $START = time();     $testvar = $foo['bar'];     for ($i = 0; $i < 10000000; ++$i) {         if ($testvar == "test") {             $j = 0;         }    }    $END = time() - $START;    print "Var took $END seconds\n";?>