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.2.00.0000.01419.46
7.1.70.0030.00717.35
7.1.60.0070.01719.82
7.1.50.0040.01816.99
7.1.00.0030.09322.36
7.0.200.0080.00516.85
7.0.140.0030.06721.99
7.0.100.0070.08019.92
7.0.90.0070.05319.82
7.0.80.0070.08019.81
7.0.70.0130.06719.94
7.0.60.0100.07719.88
7.0.50.0100.08020.25
7.0.40.0070.08020.13
7.0.30.0070.06719.95
7.0.20.0100.08320.01
7.0.10.0200.07019.98
7.0.00.0070.08019.95
5.6.280.0070.06721.11
5.6.250.0100.08320.77
5.6.240.0030.09020.68
5.6.230.0070.05020.61
5.6.220.0130.05020.63
5.6.210.0070.08020.52
5.6.200.0130.07021.09
5.6.190.0130.08321.07
5.6.180.0100.09020.92
5.6.170.0130.06721.04
5.6.160.0070.07721.13
5.6.150.0070.08321.04
5.6.140.0070.07021.00
5.6.130.0030.07321.02
5.6.120.0100.08021.13
5.6.110.0070.08721.03
5.6.100.0070.08021.00
5.6.90.0030.07320.87
5.6.80.0100.04020.39
5.6.70.0100.07320.29
5.6.60.0070.06720.33
5.6.50.0130.04320.34
5.6.40.0100.08020.48
5.6.30.0070.05320.43
5.6.20.0130.06720.32
5.6.10.0000.04720.44
5.6.00.0030.07720.38
5.5.380.0100.07720.32
5.5.370.0130.08320.47
5.5.360.0170.06720.36
5.5.350.0170.06020.41
5.5.340.0100.06320.89
5.5.330.0070.07720.89
5.5.320.0170.07020.60
5.5.310.0100.04020.76
5.5.300.0130.03320.88
5.5.290.0000.05320.79
5.5.280.0100.06320.86
5.5.270.0070.08320.86
5.5.260.0170.07320.72
5.5.250.0070.07720.63
5.5.240.0070.03720.17
5.5.230.0070.03720.09
5.5.220.0100.07020.26
5.5.210.0000.08020.09
5.5.200.0030.06020.11
5.5.190.0130.03720.23
5.5.180.0070.06020.03
5.5.160.0070.08320.23
5.5.150.0000.06320.17
5.5.140.0070.06320.19
5.5.130.0170.06320.08
5.5.120.0200.06020.21
5.5.110.0030.08720.17
5.5.100.0030.07320.06
5.5.90.0100.07720.02
5.5.80.0100.06020.13
5.5.70.0100.08019.89
5.5.60.0030.05020.11
5.5.50.0030.07719.88
5.5.40.0070.06720.10
5.5.30.0100.06020.03
5.5.20.0130.05720.09
5.5.10.0030.04319.99
5.5.00.0030.07720.08
5.4.450.0100.06719.33
5.4.440.0070.08019.56
5.4.430.0070.07319.45
5.4.420.0170.07019.30
5.4.410.0100.05719.27
5.4.400.0070.03319.08
5.4.390.0030.08318.82
5.4.380.0130.03719.02
5.4.370.0100.07019.23
5.4.360.0070.06319.08
5.4.350.0000.08019.04
5.4.340.0100.04719.14
5.4.320.0100.06019.12
5.4.310.0030.07318.80
5.4.300.0070.05019.03
5.4.290.0070.06019.04
5.4.280.0100.07319.12
5.4.270.0070.05718.90
5.4.260.0100.05719.03
5.4.250.0130.07019.11
5.4.240.0070.07718.94
5.4.230.0130.07318.96
5.4.220.0130.07019.02
5.4.210.0030.07719.11
5.4.200.0030.07718.98
5.4.190.0000.08019.04
5.4.180.0100.06718.80
5.4.170.0130.07318.96
5.4.160.0130.05718.88
5.4.150.0100.05319.08
5.4.140.0100.03316.33
5.4.130.0030.03716.42
5.4.120.0130.06316.24
5.4.110.0130.07016.24
5.4.100.0030.07716.27
5.4.90.0070.07716.44
5.4.80.0030.07716.24
5.4.70.0100.06716.29
5.4.60.0130.06016.20
5.4.50.0030.04316.39
5.4.40.0070.04316.38
5.4.30.0130.06716.36
5.4.20.0070.07016.25
5.4.10.0100.04016.41
5.4.00.0100.07015.73
5.3.290.0130.07014.64
5.3.280.0030.07014.60
5.3.270.0030.05014.61
5.3.260.0130.07014.60
5.3.250.0170.06714.44
5.3.240.0130.07314.48
5.3.230.0230.05714.54
5.3.220.0070.07314.44
5.3.210.0130.05014.44
5.3.200.0130.05314.49
5.3.190.0100.05714.40
5.3.180.0070.06314.39
5.3.170.0070.06014.57
5.3.160.0030.05014.44
5.3.150.0070.06314.51
5.3.140.0030.08314.53
5.3.130.0000.07714.55
5.3.120.0070.08314.41
5.3.110.0030.08014.55
5.3.100.0000.07014.04
5.3.90.0100.06314.00
5.3.80.0130.05314.03
5.3.70.0100.07014.01
5.3.60.0130.07313.92
5.3.50.0030.07713.82
5.3.40.0030.08013.91
5.3.30.0070.06013.91
5.3.20.0070.07713.69
5.3.10.0070.07313.55
5.3.00.0130.05713.51
5.2.170.0070.03011.14
5.2.160.0070.04011.16
5.2.150.0100.06311.16
5.2.140.0030.06311.20
5.2.130.0030.06711.12
5.2.120.0130.05310.97
5.2.110.0070.06311.11
5.2.100.0030.06011.11
5.2.90.0030.03011.06
5.2.80.0100.05011.05
5.2.70.0070.06311.09
5.2.60.0070.05711.06
5.2.50.0030.05310.88
5.2.40.0100.06010.93
5.2.30.0030.05711.04
5.2.20.0130.05710.93
5.2.10.0070.04710.87
5.2.00.0130.05010.84
5.1.60.0030.05710.11
5.1.50.0030.0609.95
5.1.40.0030.0539.88
5.1.30.0100.04010.32
5.1.20.0100.04010.38
5.1.10.0000.06010.17
5.1.00.0100.05010.18
5.0.50.0000.0278.64
5.0.40.0030.0478.37
5.0.30.0000.0408.39
5.0.20.0070.0408.27
5.0.10.0000.0478.25
5.0.00.0030.0738.27
4.4.90.0000.0335.84
4.4.80.0030.0305.85
4.4.70.0000.0335.73
4.4.60.0070.0305.74
4.4.50.0000.0335.84
4.4.40.0030.0475.80
4.4.30.0030.0175.82
4.4.20.0030.0335.91
4.4.10.0030.0335.93
4.4.00.0000.0575.77
4.3.110.0070.0305.75
4.3.100.0030.0375.75
4.3.90.0000.0235.65
4.3.80.0070.0435.69
4.3.70.0030.0175.72
4.3.60.0030.0175.69
4.3.50.0070.0335.75
4.3.40.0030.0475.61
4.3.30.0070.0305.53
4.3.20.0030.0235.53
4.3.10.0030.0335.53
4.3.00.0030.0335.53

preferences:
35.95 ms | 400 KiB | 5 Q