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)
7.4.00.0040.01514.96
7.3.120.0130.00715.05
7.3.110.0030.01514.44
7.3.100.0030.01414.94
7.3.90.0030.01614.80
7.3.80.0040.00814.94
7.3.70.0090.00914.60
7.3.60.0030.01014.52
7.3.50.0100.00614.93
7.3.40.0090.00614.70
7.3.30.0140.00314.85
7.3.20.0060.01016.67
7.3.10.0080.00316.50
7.3.00.0090.00616.84
7.2.250.0090.00614.89
7.2.240.0070.01115.17
7.2.230.0120.00314.96
7.2.220.0090.00614.81
7.2.210.0000.01014.91
7.2.200.0070.01015.27
7.2.190.0030.00915.17
7.2.180.0070.01015.16
7.2.170.0100.00714.91
7.2.00.0060.00619.23
7.1.330.0130.00315.73
7.1.320.0060.00915.82
7.1.310.0070.00715.97
7.1.300.0090.00615.87
7.1.290.0030.01015.93
7.1.280.0070.00715.95
7.1.270.0030.01415.86
7.1.260.0070.00715.88
7.1.70.0090.00617.23
7.1.60.0070.00719.22
7.1.50.0080.01334.86
7.1.00.0070.07322.40
7.0.200.0060.00316.84
7.0.140.0070.07322.00
7.0.100.0470.07321.86
7.0.90.0030.09719.89
7.0.80.0070.08019.89
7.0.70.0100.08319.94
7.0.60.0070.08720.01
7.0.50.0170.06720.27
7.0.40.0130.05320.11
7.0.30.0030.08720.04
7.0.20.0070.08320.08
7.0.10.0000.09020.16
7.0.00.0030.08320.10
5.6.280.0070.09021.00
5.6.250.0100.07720.57
5.6.240.0070.08020.66
5.6.230.0070.08320.68
5.6.220.0000.09320.70
5.6.210.0070.08320.45
5.6.200.0100.08321.11
5.6.190.0070.07021.17
5.6.180.0130.07721.12
5.6.170.0130.08021.01
5.6.160.0000.09020.95
5.6.150.0100.05021.13
5.6.140.0100.07721.02
5.6.130.0070.08020.93
5.6.120.0070.07021.00
5.6.110.0030.09321.06
5.6.100.0070.08321.00
5.6.90.0130.08021.09
5.6.80.0070.04020.31
5.6.70.0100.07020.31
5.6.60.0070.08020.41
5.6.50.0070.06720.42
5.6.40.0100.06720.34
5.6.30.0000.09320.46
5.6.20.0070.08320.42
5.6.10.0100.05720.31
5.6.00.0030.04320.40
5.5.380.0170.06720.54
5.5.370.0170.07720.51
5.5.360.0130.07320.41
5.5.350.0100.07720.39
5.5.340.0070.09020.80
5.5.330.0070.08320.77
5.5.320.0100.07720.89
5.5.310.0070.06720.84
5.5.300.0070.08320.87
5.5.290.0130.07720.79
5.5.280.0230.07020.91
5.5.270.0130.07020.81
5.5.260.0070.10020.78
5.5.250.0170.08020.64
5.5.240.0170.05320.27
5.5.230.0070.04720.14
5.5.220.0100.06720.13
5.5.210.0070.06720.10
5.5.200.0030.05720.12
5.5.190.0100.08320.14
5.5.180.0170.04020.19
5.5.160.0030.07720.08
5.5.150.0100.04020.07
5.5.140.0170.06720.20
5.5.130.0070.07720.17
5.5.120.0000.08320.12
5.5.110.0030.05020.18
5.5.100.0100.07720.15
5.5.90.0030.05020.14
5.5.80.0130.08020.09
5.5.70.0070.08020.08
5.5.60.0070.07720.05
5.5.50.0100.07019.93
5.5.40.0000.08020.05
5.5.30.0030.05320.07
5.5.20.0170.06720.09
5.5.10.0030.08320.12
5.5.00.0130.07020.03
5.4.450.0070.07319.24
5.4.440.0000.07319.42
5.4.430.0030.09019.26
5.4.420.0100.07719.44
5.4.410.0030.08019.16
5.4.400.0030.08018.95
5.4.390.0100.08019.07
5.4.380.0100.05019.13
5.4.370.0030.03319.06
5.4.360.0030.06718.98
5.4.350.0070.06318.96
5.4.340.0030.05719.02
5.4.320.0170.06319.22
5.4.310.0130.06318.90
5.4.300.0130.04719.05
5.4.290.0170.07318.98
5.4.280.0030.04719.08
5.4.270.0030.07718.89
5.4.260.0000.07719.14
5.4.250.0100.07318.95
5.4.240.0030.07018.97
5.4.230.0100.07319.11
5.4.220.0100.06018.97
5.4.210.0070.04719.07
5.4.200.0130.07019.21
5.4.190.0130.07019.13
5.4.180.0130.05318.97
5.4.170.0070.08019.21
5.4.160.0200.06718.79
5.4.150.0130.07318.79
5.4.140.0100.07316.29
5.4.130.0100.07316.17
5.4.120.0030.07716.07
5.4.110.0000.07016.26
5.4.100.0100.07016.36
5.4.90.0130.06716.43
5.4.80.0070.07316.39
5.4.70.0070.07016.21
5.4.60.0070.07316.19
5.4.50.0070.06716.33
5.4.40.0030.08016.46
5.4.30.0130.06316.35
5.4.20.0030.07316.42
5.4.10.0170.06316.41
5.4.00.0030.07315.52
5.3.290.0100.08314.57
5.3.280.0170.06714.43
5.3.270.0100.08014.44
5.3.260.0070.08014.60
5.3.250.0030.08014.43
5.3.240.0130.06014.51
5.3.230.0070.07714.45
5.3.220.0030.08014.39
5.3.210.0070.08314.55
5.3.200.0000.08014.57
5.3.190.0030.07714.40
5.3.180.0030.08714.54
5.3.170.0030.03714.54
5.3.160.0000.08014.56
5.3.150.0100.07014.56
5.3.140.0130.07014.54
5.3.130.0030.08314.49
5.3.120.0070.07714.36
5.3.110.0100.08014.53
5.3.100.0130.07313.98
5.3.90.0070.07714.00
5.3.80.0030.08713.80
5.3.70.0130.07013.99
5.3.60.0170.06713.95
5.3.50.0030.08313.81
5.3.40.0100.07013.93
5.3.30.0070.07713.89
5.3.20.0070.07313.64
5.3.10.0070.07013.59
5.3.00.0130.06713.62
5.2.170.0030.07012.37
5.2.160.0070.06312.37
5.2.150.0030.05012.37
5.2.140.0000.06012.37
5.2.130.0030.06012.37
5.2.120.0100.06012.37
5.2.110.0130.06012.37
5.2.100.0030.06712.37
5.2.90.0030.06312.37
5.2.80.0030.07012.37
5.2.70.0100.06312.37
5.2.60.0070.06312.37
5.2.50.0000.07312.37
5.2.40.0000.07312.37
5.2.30.0100.06012.37
5.2.20.0070.06012.37
5.2.10.0030.07012.37
5.2.00.0030.04312.37
5.1.60.0100.05012.37
5.1.50.0100.05012.37
5.1.40.0100.04712.37
5.1.30.0170.04012.37
5.1.20.0070.06012.37
5.1.10.0070.06012.37
5.1.00.0030.06012.37
5.0.50.0100.04712.37
5.0.40.0070.05012.37
5.0.30.0030.06312.37
5.0.20.0030.02712.37
5.0.10.0070.04012.37
5.0.00.0000.07312.37
4.4.90.0100.03012.37
4.4.80.0100.02712.37
4.4.70.0000.02012.37
4.4.60.0000.03712.37
4.4.50.0030.01712.37
4.4.40.0000.05712.37
4.4.30.0000.03712.37
4.4.20.0100.02312.37
4.4.10.0000.04012.37
4.4.00.0000.05712.37
4.3.110.0000.02312.37
4.3.100.0000.03712.37
4.3.90.0030.02312.37
4.3.80.0030.05312.37
4.3.70.0000.02712.37
4.3.60.0030.02312.37
4.3.50.0030.02712.37
4.3.40.0070.03312.37
4.3.30.0030.01712.37
4.3.20.0000.03712.37
4.3.10.0000.03012.37
4.3.00.0000.03312.37

preferences:
36.1 ms | 401 KiB | 5 Q