3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n=9000000; $a=1; $b=2; $start=microtime(1); for($i=1;$i<=$n;$i++) { if ($a!=$b) $c=$a+$b;else $c=8; } print (microtime(1)-$start)."\n"; $start=microtime(1); for($i=1;$i<=$n;$i++) { $c=($a!=$b)?($a+$b):8; } print (microtime(1)-$start)."\n";

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.3.10.0100.33116.47
7.3.00.0030.33316.80
7.2.130.0030.33416.48
7.2.120.0070.32816.97
7.2.110.0030.33116.68
7.2.100.0030.32316.77
7.2.90.0130.33216.86
7.2.80.0030.32516.91
7.2.70.0070.35116.96
7.2.60.0100.32916.93
7.2.50.0030.33417.05
7.2.40.0000.34216.98
7.2.30.0030.33617.09
7.2.20.0070.32516.97
7.2.10.0030.32216.64
7.2.00.0000.32916.89
7.1.250.0101.13415.71
7.1.70.0030.33817.38
7.1.60.0070.38819.29
7.1.50.0070.39316.86
7.1.00.0070.42722.40
7.0.200.0130.34916.73
7.0.140.0070.43021.96
7.0.100.0100.38720.06
7.0.90.0030.42720.05
7.0.80.0130.36019.93
7.0.70.0130.31019.94
7.0.60.0100.29020.08
7.0.50.0070.42020.41
7.0.40.0030.37720.18
7.0.30.0100.41020.13
7.0.20.0070.40720.13
7.0.10.0130.41320.13
7.0.00.0030.41320.07
5.6.280.0100.98720.78
5.6.250.0070.84320.48
5.6.240.0000.84720.75
5.6.230.0100.84720.62
5.6.220.0130.71020.73
5.6.210.0100.66720.68
5.6.200.0030.86021.08
5.6.190.0030.89021.04
5.6.180.0130.86021.03
5.6.170.0070.85720.95
5.6.160.0030.85021.06
5.6.150.0170.86321.03
5.6.140.0130.86021.00
5.6.130.0100.84721.11
5.6.120.0130.84721.13
5.6.110.0030.79021.00
5.6.100.0170.84021.00
5.6.90.0070.79721.02
5.6.80.0000.86320.41
5.6.70.0030.80720.51
5.6.60.0070.83320.39
5.6.50.0070.76320.47
5.6.40.0030.83320.38
5.6.30.0070.87320.49
5.6.20.0000.88020.38
5.6.10.0070.85020.37
5.6.00.0200.84020.28
5.5.380.0030.78320.41
5.5.370.0000.78020.54
5.5.360.0000.71320.34
5.5.350.0000.66320.42
5.5.340.0030.88020.73
5.5.330.0000.82320.83
5.5.320.0070.83320.77
5.5.310.0000.79720.88
5.5.300.0100.79320.86
5.5.290.0100.89020.75
5.5.280.0030.85020.82
5.5.270.0070.83720.91
5.5.260.0100.72020.84
5.5.250.0000.82020.73
5.5.240.0100.85320.21
5.5.230.0170.85320.20
5.5.220.0100.87720.29
5.5.210.0030.86720.20
5.5.200.0030.67020.18
5.5.190.0070.80020.18
5.5.180.0000.73020.12
5.5.160.0070.86020.15
5.5.150.0000.66020.10
5.5.140.0070.72020.26
5.5.130.0030.67720.24
5.5.120.0130.85320.23
5.5.110.0070.83319.95
5.5.100.0030.82320.07
5.5.90.0130.81720.15
5.5.80.0030.81319.90
5.5.70.0030.87720.13
5.5.60.0030.85020.13
5.5.50.0200.82020.05
5.5.40.0130.83720.13
5.5.30.0030.69320.07
5.5.20.0030.84020.12
5.5.10.0100.78720.04
5.5.00.0030.80320.11
5.4.450.0170.85319.40
5.4.440.0000.88719.43
5.4.430.0100.81019.44
5.4.420.0000.87019.23
5.4.410.0070.73719.18
5.4.400.0100.95719.03
5.4.390.0100.89319.06
5.4.380.0100.82719.12
5.4.370.0070.85018.92
5.4.360.0030.70719.05
5.4.350.0070.86718.98
5.4.340.0070.86019.06
5.4.320.0100.88718.81
5.4.310.0000.67319.23
5.4.300.0000.68718.79
5.4.290.0070.66018.75
5.4.280.0000.72719.02
5.4.270.0030.85718.94
5.4.260.0070.86018.81
5.4.250.0100.85319.07
5.4.240.0030.88018.91
5.4.230.0100.85719.05
5.4.220.0070.86718.77
5.4.210.0100.86718.97
5.4.200.0070.87319.03
5.4.190.0100.87019.13
5.4.180.0030.84318.81
5.4.170.0070.86319.13
5.4.160.1270.65319.10
5.4.150.0000.87019.07
5.4.140.0070.85716.28
5.4.130.0070.86716.26
5.4.120.0130.74716.32
5.4.110.0070.81316.42
5.4.100.0030.85316.30
5.4.90.0070.88016.23
5.4.80.0030.85716.41
5.4.70.0000.74716.29
5.4.60.0070.88316.28
5.4.50.0030.85716.38
5.4.40.1030.66016.26
5.4.30.0000.87016.33
5.4.20.0070.69316.40
5.4.10.0070.70716.14
5.4.00.0000.72715.83
5.3.290.0030.98014.65
5.3.280.0071.09014.54
5.3.270.0000.98014.43
5.3.260.0001.17314.59
5.3.250.0031.08714.54
5.3.240.0030.99314.56
5.3.230.0000.95014.41
5.3.220.0071.09014.42
5.3.210.0101.14714.52
5.3.200.0031.13014.57
5.3.190.0071.15314.50
5.3.180.0071.10714.50
5.3.170.0071.17014.54
5.3.160.0071.13314.40
5.3.150.0030.97014.40
5.3.140.0001.26314.49
5.3.130.0001.16014.50
5.3.120.0071.00014.55
5.3.110.0070.94314.53
5.3.100.1970.98013.87
5.3.90.0031.11013.99
5.3.80.0071.12313.87
5.3.70.0071.24713.77
5.3.60.0001.08313.91
5.3.50.0101.11313.90
5.3.40.0000.97013.79
5.3.30.0001.19713.82
5.3.20.0071.08713.65
5.3.10.0031.18313.51
5.3.00.0170.99313.49
5.2.170.0071.55312.73
5.2.160.0031.57312.73
5.2.150.0031.42012.73
5.2.140.0031.57012.73
5.2.130.0001.53312.73
5.2.120.0031.60012.73
5.2.110.0031.51712.73
5.2.100.0071.57712.73
5.2.90.0031.59312.73
5.2.80.0031.47012.73
5.2.70.0031.46012.73
5.2.60.0071.76312.73
5.2.50.0131.58712.73
5.2.40.0001.57012.73
5.2.30.0071.44312.73
5.2.20.0001.75312.73
5.2.10.0071.39012.73
5.2.00.0101.54712.73
5.1.60.0001.57712.73
5.1.50.0071.42012.73
5.1.40.0001.53312.73
5.1.30.0001.54312.73
5.1.20.0101.52712.73
5.1.10.0001.55312.73
5.1.00.0031.56012.73
5.0.50.0032.4908.41
5.0.40.0032.4738.14
5.0.30.0072.4708.03
5.0.20.0002.50012.73
5.0.10.0002.50012.73
5.0.00.0272.4008.07
4.4.90.0102.49012.73
4.4.80.0102.2205.71
4.4.70.0172.1075.79
4.4.60.0072.49312.73
4.4.50.0072.49312.73
4.4.40.0032.4035.68
4.4.30.0072.49312.73
4.4.20.0032.4905.84
4.4.10.0002.4775.75
4.4.00.0032.49712.73
4.3.110.0072.49312.73
4.3.100.0032.4805.71
4.3.90.0132.4205.73
4.3.80.0132.4575.59
4.3.70.0102.4475.77
4.3.60.0132.4105.66
4.3.50.0032.49712.61
4.3.40.0002.4935.66
4.3.30.0232.4204.47
4.3.20.0032.4434.44
4.3.10.0032.49712.61
4.3.00.0102.4434.29

preferences:
33.03 ms | 400 KiB | 5 Q