3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $client_version_header = '1.5'; $oldVersion = false; if(!$client_version_header){ $oldVersion = true; } else { $splitted = explode('.', $client_version_header); $major = $splitted[0]; $minor = $splitted[1]; if($major < 1){ $oldVersion = true; } if($major == 1 && $minor < 5){ $oldVersion = true; } } if($oldVersion) { echo 'oldversion'; } else { echo 'newVersion'; }
based on 8kt3F

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.60.0040.01116.90
7.2.00.0070.00319.14
7.1.200.0140.00015.89
7.1.100.0030.01018.29
7.1.70.0000.00717.25
7.1.60.0130.01019.50
7.1.50.0060.01216.95
7.1.00.0000.08022.57
7.0.200.0070.00715.13
7.0.140.0030.06022.18
7.0.60.0030.08319.97
7.0.50.0070.05717.86
7.0.40.0100.05720.31
7.0.30.0300.07320.02
7.0.20.0230.09020.09
7.0.10.0030.08720.17
7.0.00.0000.06020.19
5.6.280.0030.07320.81
5.6.210.0030.06320.64
5.6.200.0030.05718.15
5.6.190.0070.07720.43
5.6.180.0370.07320.43
5.6.170.0270.07320.50
5.6.160.0100.08020.51
5.6.150.0030.04318.15
5.6.140.0100.06718.11
5.6.130.0170.07018.11
5.6.120.0170.07321.19
5.6.110.0030.08721.08
5.6.100.0070.08721.00
5.6.90.0030.08721.03
5.6.80.0130.07320.50
5.6.70.3530.03320.38
5.5.350.0100.07720.36
5.5.340.0070.05017.99
5.5.330.0070.06020.43
5.5.320.0370.07320.34
5.5.310.0170.04020.21
5.5.300.0000.04317.98
5.5.290.0100.08017.98
5.5.280.0000.04720.85
5.5.270.0100.07320.76
5.5.260.0200.07320.76
5.5.250.0100.07720.75
5.5.240.0230.07320.04
5.4.450.0400.05319.27
5.4.440.0730.06319.59
5.4.430.0230.05019.59
5.4.420.0200.07019.41
5.4.410.0130.05318.96
5.4.400.0570.04718.59
5.4.390.0330.05018.57
5.4.380.0500.04718.58
5.4.370.0570.04018.68
5.4.360.0330.05718.61
5.4.350.0370.05018.52
5.4.340.0370.05718.73
5.4.320.0330.06018.56
5.4.310.0270.05718.57
5.4.300.0370.04318.65
5.4.290.0500.06718.52
5.4.280.0370.08018.53
5.4.270.0500.05718.64
5.4.260.0400.06018.61
5.4.250.0230.07018.45
5.4.240.0500.05018.68
5.4.230.0370.08318.69
5.4.220.0470.04718.61
5.4.210.0430.04718.45
5.4.200.0330.06316.73
5.4.190.0530.06318.70
5.4.180.0430.05318.52
5.4.170.0430.07018.68
5.4.160.0500.04718.70
5.4.150.0330.05318.75
5.4.140.0330.06016.11
5.4.130.0500.05716.20
5.4.120.0270.05716.21
5.4.110.0330.04716.15
5.4.100.0470.04016.16
5.4.90.0270.05316.16
5.4.80.0330.04716.29
5.4.70.0300.05016.13
5.4.60.0400.05316.12
5.4.50.0430.06016.16
5.4.40.0430.05716.13
5.4.30.0300.04716.11
5.4.20.0230.05016.02
5.4.10.0400.07016.10
5.4.00.0500.04715.60
5.3.290.0530.04014.59
5.3.280.0570.05014.66
5.3.270.0400.06314.60
5.3.260.0330.05714.54
5.3.250.0330.05014.65
5.3.240.0400.05714.53
5.3.230.0400.06014.58
5.3.220.0370.05714.59
5.3.210.0400.05714.51
5.3.200.0330.05714.53
5.3.190.0470.04714.47
5.3.180.0430.06714.56
5.3.170.0530.06314.51
5.3.160.0370.05014.49
5.3.150.0370.07314.65
5.3.140.0370.07014.55
5.3.130.0470.07314.50
5.3.120.0330.06314.64
5.3.110.0370.06014.46
5.3.100.0530.05714.03
5.3.90.0500.07313.93
5.3.80.0430.05713.99
5.3.70.0330.07314.05
5.3.60.0530.05314.08
5.3.50.1030.06013.94
5.3.40.0500.07314.03
5.3.30.0670.06013.98
5.3.20.0370.05013.76
5.3.10.0300.07313.73
5.3.00.0530.04713.63
5.2.170.0230.05011.14
5.2.160.0270.04711.02
5.2.150.0230.05011.11
5.2.140.0270.04711.16
5.2.130.0270.03711.05
5.2.120.0300.04711.05
5.2.110.0200.06711.11
5.2.100.0370.05311.14
5.2.90.0300.04711.02
5.2.80.0170.05011.13
5.2.70.0500.04711.24
5.2.60.0500.05311.09
5.2.50.0200.04311.07
5.2.40.0230.04011.03
5.2.30.0200.04311.00
5.2.20.0200.04011.01
5.2.10.0230.04310.87
5.2.00.0200.05010.77
5.1.60.0200.03310.03
5.1.50.0270.0439.99
5.1.40.0300.04310.09
5.1.30.0330.04710.32
5.1.20.0100.06010.40
5.1.10.0200.04310.16
5.1.00.0170.05310.20
5.0.50.0170.0278.56
5.0.40.0100.0308.42
5.0.30.0100.0438.29
5.0.20.0000.0408.27
5.0.10.0130.0378.20
5.0.00.0130.0408.27
4.4.90.0100.0275.95
4.4.80.0300.0175.87
4.4.70.0130.0335.80
4.4.60.0130.0305.91
4.4.50.0170.0235.91
4.4.40.0130.0435.88
4.4.30.0130.0205.90
4.4.20.0070.0275.93
4.4.10.0030.0335.93
4.4.00.0030.0335.84
4.3.110.0130.0135.75
4.3.100.0070.0205.84
4.3.90.0000.0235.80
4.3.80.0070.0435.78
4.3.70.0070.0205.89
4.3.60.0130.0205.77
4.3.50.0100.0205.89
4.3.40.0070.0335.79
4.3.30.0030.0304.59
4.3.20.0130.0134.61
4.3.10.0070.0204.50
4.3.00.0030.0206.75