3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function array_swap(&$input, $num) { $tmp = $input[0]; $input[0] = $input[$num]; $input[$num] = $tmp; } $input = [4, 5, 8, 9, 1, 7, 2]; function xsort($oldArray) { $newArray = array(); foreach($oldArray as $arr){ $newArray[] = $arr; } return $newArray; } var_dump(xsort($input));

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.00816.92
7.2.00.0100.00019.34
7.1.200.0030.00915.73
7.1.100.0060.00818.12
7.1.70.0030.00917.27
7.1.60.0060.01919.22
7.1.50.0090.01216.89
7.1.00.0070.07322.41
7.0.200.0040.00416.93
7.0.140.0070.07022.08
7.0.60.0070.07019.95
7.0.50.0100.04317.84
7.0.40.0000.08020.23
7.0.30.0200.03720.07
7.0.20.0300.06720.33
7.0.10.0030.06720.19
7.0.00.0100.08020.07
5.6.280.0130.06321.07
5.6.210.0130.06720.47
5.6.200.0070.08718.29
5.6.190.0100.07720.57
5.6.180.0330.03320.77
5.6.170.0200.06020.56
5.6.160.0070.08720.70
5.6.150.0070.08318.15
5.6.140.0100.05318.15
5.6.130.0030.05718.23
5.6.120.0030.05321.14
5.6.110.0070.08020.89
5.6.100.0030.08721.01
5.6.90.0130.04720.93
5.6.80.0100.05320.36
5.5.350.0230.08020.31
5.5.340.0070.08318.01
5.5.330.0030.08020.38
5.5.320.0230.04320.35
5.5.310.0200.06320.30
5.5.300.0200.07017.95
5.5.290.0030.04018.02
5.5.280.0070.03720.68
5.5.270.0030.08320.85
5.5.260.0170.06320.96
5.5.250.0000.07020.69
5.5.240.0030.03020.24
5.4.450.0430.06719.21
5.4.440.0600.06319.71
5.4.430.0600.06319.49
5.4.420.0170.04719.60
5.4.410.0530.06019.07
5.4.400.0070.05719.13
5.4.390.0130.05019.29
5.4.380.0270.05318.79
5.4.370.0170.05718.59
5.4.360.0200.07718.74
5.4.350.0330.06718.72
5.4.340.0170.08018.76
5.4.320.0300.05318.77
5.4.310.0370.05318.56
5.4.300.0230.05718.55
5.4.290.0300.05718.75
5.4.280.0400.06018.77
5.4.270.0330.07018.73
5.4.260.0230.07318.55
5.4.250.0330.05718.69
5.4.240.0230.08018.84
5.4.230.0430.06018.51
5.4.220.0400.06718.84
5.4.210.0170.07318.58
5.4.200.0370.04716.58
5.4.190.0230.06318.82
5.4.180.0270.07318.54
5.4.170.0330.06718.81
5.4.160.0330.06318.83
5.4.150.0400.06018.60
5.4.140.0200.05316.11
5.4.130.0230.04716.25
5.4.120.0130.06016.30
5.4.110.0300.05316.46
5.4.100.0270.05716.21
5.4.90.0270.05716.37
5.4.80.0330.06716.31
5.4.70.0300.07016.33
5.4.60.0270.05316.27
5.4.50.0230.05316.25
5.4.40.0200.05716.29
5.4.30.0270.04716.17
5.4.20.0230.05016.15
5.4.10.0270.06016.15
5.4.00.0330.07015.64
5.3.290.0200.06714.71
5.3.280.0370.05014.65
5.3.270.0330.05014.66
5.3.260.0270.05714.83
5.3.250.0370.04714.62
5.3.240.0270.06014.74
5.3.230.0170.05314.78
5.3.220.0300.04014.59
5.3.210.0200.05714.79
5.3.200.0230.05014.70
5.3.190.0230.07014.54
5.3.180.0130.06014.67
5.3.170.0370.04014.61
5.3.160.0200.05714.55
5.3.150.0330.04314.67
5.3.140.0230.07314.73
5.3.130.0300.06014.55
5.3.120.0370.06314.67
5.3.110.0230.05314.68
5.3.100.0400.04014.16
5.3.90.0130.05714.04
5.3.80.0230.04714.12
5.3.70.0300.04313.99
5.3.60.0230.06314.17
5.3.50.0330.05714.05
5.3.40.0130.07014.00
5.3.30.0270.06313.96
5.3.20.0270.05313.91
5.3.10.0200.05013.77
5.3.00.0270.04713.80
5.2.170.0200.05711.13
5.2.160.0270.03011.15
5.2.150.0200.05011.18
5.2.140.0130.04711.18
5.2.130.0200.05311.13
5.2.120.0230.05311.16
5.2.110.0130.06311.09
5.2.100.0200.05311.30
5.2.90.0230.05311.10
5.2.80.0200.05311.20
5.2.70.0170.04011.20
5.2.60.0230.04011.25
5.2.50.0200.04311.12
5.2.40.0230.05311.03
5.2.30.0270.05711.08
5.2.20.0230.05310.99
5.2.10.0230.03710.88
5.2.00.0170.03710.89
5.1.60.0130.04010.03
5.1.50.0230.03010.03
5.1.40.0200.05010.00
5.1.30.0170.05310.41
5.1.20.0200.03310.57
5.1.10.0230.03310.17
5.1.00.0270.02710.07
5.0.50.0170.0238.72
5.0.40.0070.0308.54
5.0.30.0070.0478.42
5.0.20.0130.0278.23
5.0.10.0200.0178.27
5.0.00.0170.0408.20
4.4.90.0100.0235.92
4.4.80.0130.0235.88
4.4.70.0030.0335.95
4.4.60.0070.0235.89
4.4.50.0170.0235.93
4.4.40.0030.0505.97
4.4.30.0070.0305.88
4.4.20.0100.0205.94
4.4.10.0130.0236.05
4.4.00.0070.0405.92
4.3.110.0100.0275.81
4.3.100.0100.0275.87
4.3.90.0170.0175.81
4.3.80.0030.0405.83
4.3.70.0030.0235.82
4.3.60.0070.0205.88
4.3.50.0070.0235.82
4.3.40.0070.0375.83
4.3.30.0030.0234.60
4.3.20.0030.0234.64
4.3.10.0030.0234.60
4.3.00.0100.02310.30