3v4l.org

run code in 300+ PHP versions simultaneously
<?php $times = 10000; $var = null; $var = new stdClass(); $time1 = microtime(true); for ($i = 0; $i <= $times; $i++) { if (!$var) {} } $time1 = microtime(true) - $time1; //echo "Time using '!': $time1\n"; $time2 = microtime(true); for ($i = 0; $i <= $times; $i++) { if ($var === null) {} } $time2 = microtime(true) - $time2; //echo "Time using '===': $time2\n"; if ($time1 > $time2){ $p = ($time1-$time2)/$time2; printf("'===' was faster by %.2d percent.", $p); } else { $p = ($time2-$time1)/$time1; printf("'!' was faster by %.2d percent."$p); }
Output for 5.4.0 - 5.4.12, 5.4.14
Parse error: syntax error, unexpected '$p' (T_VARIABLE) in erJut on line 34
Process exited with code 255.
Output for 5.4.13
Parse error: syntax error, unexpected '$p' (T_VARIABLE) in /in/7X3hB on line 34
Process exited with code 255.
Output for 5.3.0 - 5.3.22, 5.3.24
Parse error: syntax error, unexpected T_VARIABLE in erJut on line 34
Process exited with code 255.
Output for 5.3.23
Parse error: syntax error, unexpected T_VARIABLE in /in/7X3hB on line 34
Process exited with code 255.

preferences:
173.2 ms | 1395 KiB | 47 Q