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

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)
7.4.00.0030.01415.02
7.3.120.0130.00714.61
7.3.110.0090.00914.87
7.3.100.0040.01114.68
7.3.90.0090.00914.94
7.3.80.0060.00915.09
7.3.70.0040.01214.87
7.3.60.0030.01314.79
7.3.50.0060.01214.92
7.3.40.0060.00614.93
7.3.30.0000.01014.87
7.3.20.0070.00416.55
7.3.10.0060.00916.27
7.3.00.0050.00616.55
7.2.250.0070.00715.08
7.2.240.0090.00915.22
7.2.230.0150.00414.99
7.2.220.0060.01215.00
7.2.210.0030.01215.32
7.2.200.0070.00714.85
7.2.190.0030.01015.14
7.2.180.0080.00814.73
7.2.170.0070.01115.08
7.2.130.0000.01416.68
7.2.120.0030.01016.72
7.2.110.0080.00416.79
7.2.100.0070.01016.68
7.2.90.0090.00616.49
7.2.80.0040.01416.45
7.2.70.0030.01016.43
7.2.60.0030.01016.71
7.2.50.0000.01516.67
7.2.40.0100.00316.61
7.2.30.0000.01116.52
7.2.20.0030.00816.58
7.2.10.0100.00316.23
7.2.00.0070.00617.98
7.1.330.0090.00615.60
7.1.320.0120.00315.54
7.1.310.0070.01115.71
7.1.300.0060.00915.97
7.1.290.0000.01215.81
7.1.280.0040.01415.89
7.1.270.0000.01415.81
7.1.260.0030.01015.99
7.1.250.0080.00615.61
7.1.70.0030.00917.25
7.1.60.0120.01219.40
7.1.50.0070.01416.72
7.1.00.0000.07322.27
7.0.200.0000.01116.61
7.0.140.0100.06722.05
7.0.120.0000.05322.12
7.0.60.0030.08019.83
7.0.50.0070.06717.85
7.0.40.0070.05320.21
7.0.30.0230.04720.21
7.0.20.0200.05020.13
7.0.10.0300.06720.21
7.0.00.0100.04020.21
5.6.280.0070.06721.11
5.6.210.0170.07020.72
5.6.200.0100.08318.12
5.6.190.0070.09020.48
5.6.180.0370.04320.41
5.6.170.0270.03720.49
5.6.160.0030.05720.49
5.6.150.0030.05318.21
5.6.140.0070.08318.13
5.6.130.0100.06718.15
5.6.120.0000.06021.03
5.6.110.0130.07321.04
5.6.100.0230.06021.08
5.6.90.0030.09721.00
5.6.80.0270.06720.46
5.6.70.1430.04020.28
5.5.350.0330.06020.41
5.5.340.0030.07017.99
5.5.330.0330.03020.36
5.5.320.0200.06720.44
5.5.310.0230.08320.41
5.5.300.0130.07717.96
5.5.290.0070.08318.01
5.5.280.0100.08020.76
5.5.270.0070.04720.72
5.5.260.0070.08720.86
5.5.250.0030.09020.77
5.5.240.0130.07320.23
5.4.450.0200.06019.11
5.4.440.0070.08019.11
5.4.430.0130.06719.36
5.4.420.0000.08319.44
5.4.410.0030.04319.20
5.4.400.0030.03718.80
5.4.390.0070.03719.14
5.4.380.0030.03719.14
5.4.370.0030.04019.08
5.4.360.0000.04018.79
5.4.350.0030.03719.18
5.4.340.0030.03719.14
5.4.320.0000.04319.08
5.4.310.0070.03318.79
5.4.300.0000.04019.17
5.4.290.0030.03718.79
5.4.280.0070.03318.79
5.4.270.0070.04319.07
5.4.260.0100.06719.12
5.4.250.0070.03719.17
5.4.240.0070.04319.17
5.4.230.0070.07318.90
5.4.220.0030.07718.79
5.4.210.0030.04719.09
5.4.200.0030.04019.07
5.4.190.0070.06019.09
5.4.180.0100.07719.07
5.4.170.0200.03018.91
5.4.160.0030.04018.78
5.4.150.0000.06319.06
5.4.140.0100.06016.30
5.4.130.0030.04316.25
5.4.120.0070.06016.36
5.4.110.0030.04316.40
5.4.100.0000.06016.30
5.4.90.0030.04016.36
5.4.80.0000.06316.35
5.4.70.0030.03716.35
5.4.60.0030.03716.12
5.4.50.0030.03716.34
5.4.40.0070.04016.36
5.4.30.0070.07016.16
5.4.20.0070.07316.39
5.4.10.0100.06016.21
5.4.00.0100.04715.71
5.3.290.0030.04314.61
5.3.280.0100.08014.61
5.3.270.0030.08314.53
5.3.260.0100.07314.57
5.3.250.0030.04314.55
5.3.240.0030.04014.62
5.3.230.0100.06014.52
5.3.220.0030.07314.50
5.3.210.0070.06714.53
5.3.200.0030.04014.54
5.3.190.0070.03314.49
5.3.180.0100.06014.54
5.3.170.0000.08714.50
5.3.160.0000.04314.49
5.3.150.0030.04014.35
5.3.140.0130.05014.55
5.3.130.0100.07014.46
5.3.120.0030.07714.48
5.3.110.0030.06014.48
5.3.100.0070.07013.95
5.3.90.0100.03313.95
5.3.80.0030.04013.84
5.3.70.0070.07313.96
5.3.60.0000.05013.82
5.3.50.0030.07713.96
5.3.40.0000.08313.80
5.3.30.0130.04313.73
5.3.20.0100.06713.64
5.3.10.0030.03713.59
5.3.00.0000.05313.60
5.2.170.0000.06711.04
5.2.160.0070.03711.01
5.2.150.0070.06011.14
5.2.140.0030.06311.12
5.2.130.0100.04711.04
5.2.120.0030.04311.07
5.2.110.0000.03711.05
5.2.100.0070.05311.05
5.2.90.0130.02311.01
5.2.80.0070.06311.10
5.2.70.0030.06711.05
5.2.60.0070.05011.01
5.2.50.0070.04711.02
5.2.40.0030.04711.01
5.2.30.0000.06711.01
5.2.20.0070.03311.01
5.2.10.0070.06311.01
5.2.00.0030.03711.01
5.1.60.0030.03011.01
5.1.50.0030.03011.01
5.1.40.0100.03311.01
5.1.30.0030.05011.01
5.1.20.0000.06311.01
5.1.10.0070.04311.01
5.1.00.0000.05711.01
5.0.50.0070.04311.01
5.0.40.0030.02311.01
5.0.30.0030.04011.01
5.0.20.0030.05011.01
5.0.10.0100.04711.01
5.0.00.0000.05711.01
4.4.90.0000.01711.01
4.4.80.0000.04011.01
4.4.70.0070.01711.01
4.4.60.0030.01711.01
4.4.50.0000.03011.01
4.4.40.0030.04711.01
4.4.30.0030.01711.01
4.4.20.0000.03311.01
4.4.10.0000.04011.01
4.4.00.0070.04711.01
4.3.110.0100.03011.01
4.3.100.0100.02011.01
4.3.90.0030.02011.01
4.3.80.0000.05711.01
4.3.70.0030.01711.01
4.3.60.0000.03311.01
4.3.50.0000.02011.01
4.3.40.0000.04311.01
4.3.30.0030.02011.01
4.3.20.0000.02011.01
4.3.10.0000.01711.01
4.3.00.0000.01711.01

preferences:
39.68 ms | 401 KiB | 5 Q