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 instanceof stdClass) {} } $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) * 100; //printf("'!== null' was faster by %.2f percent.", $p); printf("'!== null' was faster"); } else { $p = (($time2-$time1)/$time1) * 100; //printf("'instanceof' was faster by %.2f percent.", $p); printf("'instanceof' was faster); }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.140.0270.06016.32
5.4.130.0200.07716.45
5.4.120.0230.06316.46
5.4.110.0370.06016.39
5.4.100.0170.05316.39
5.4.90.0170.04716.21
5.4.80.0270.06716.46
5.4.70.0230.05316.45
5.4.60.0230.04716.37
5.4.50.0200.06716.38
5.4.40.0270.06716.47
5.4.30.0370.03016.45
5.4.20.0130.05316.36
5.4.10.0200.06316.47
5.4.00.0200.07015.81
5.3.240.0230.06714.59
5.3.230.0230.05014.54
5.3.220.0270.06314.57
5.3.210.0300.06314.42
5.3.200.0230.05314.41
5.3.190.0300.07014.50
5.3.180.0200.04014.52
5.3.170.0170.08014.39
5.3.160.0200.04014.43
5.3.150.0170.07714.42
5.3.140.0270.07014.44
5.3.130.0230.07014.46
5.3.120.0170.05314.43
5.3.110.0230.06014.50
5.3.100.0130.08014.04
5.3.90.0230.06013.88
5.3.80.0270.05314.01
5.3.70.0300.06013.87
5.3.60.0200.04713.79
5.3.50.0300.06713.88
5.3.40.0170.05013.80
5.3.30.0170.05013.84
5.3.20.0230.07313.63
5.3.10.0230.06713.50
5.3.00.0200.06313.57

preferences:
141.07 ms | 1394 KiB | 7 Q