3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $total_pages = 100; $current_page = 50; $boundaries = 2; $around = 2; $arr1 = range(1, $boundaries); $arr2 = range($total_pages - max(($boundaries - 1), 0), $total_pages); $arr3 = range(min($current_page - $around, 1), $current_page); $arr4 = range($current_page, $current_page + $around); $result = array_unique(array_merge($arr1, $arr2, $arr3, $arr4)); sort($result); var_dump($arr2 ); ?>
based on jdWX6

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.3.10.0040.01116.49
7.3.00.0030.01316.31
7.2.130.0040.01116.78
7.2.120.0070.00716.95
7.2.110.0070.00416.80
7.2.100.0080.00416.81
7.2.90.0120.00316.86
7.2.80.0050.00916.72
7.2.70.0030.00916.66
7.2.60.0100.00516.79
7.2.50.0120.00316.83
7.2.40.0000.01116.68
7.2.30.0000.01317.00
7.2.20.0030.01016.58
7.2.10.0030.00916.53
7.2.00.0080.00518.01
7.1.250.0080.00415.77
7.1.200.0190.00515.25
7.1.100.0060.00618.08
7.1.70.0030.01217.22
7.1.60.0060.01919.36
7.1.50.0070.01416.86
7.1.00.0100.07022.37
7.0.200.0050.01014.84
7.0.60.0030.05719.88
7.0.50.0100.06017.93
7.0.40.0130.05720.04
7.0.30.0300.07020.17
7.0.20.0230.07020.14
7.0.10.0030.05020.32
7.0.00.0000.05020.13
5.6.280.0030.07320.86
5.6.210.0030.07320.54
5.6.200.0100.03718.21
5.6.190.0030.04320.58
5.6.180.0130.07720.41
5.6.170.0270.08320.54
5.6.160.0130.07020.41
5.6.150.0070.08718.22
5.6.140.0070.04718.17
5.6.130.0070.04318.21
5.6.120.0130.08320.89
5.6.110.0100.08020.99
5.6.100.0130.07721.08
5.6.90.0070.06721.03
5.6.80.0030.04020.40
5.5.350.0230.06320.33
5.5.340.0030.04317.98
5.5.330.0100.08020.07
5.5.320.0200.04720.18
5.5.310.0170.04720.41
5.5.300.0000.05717.91
5.5.290.0100.08017.96
5.5.280.0100.06320.63
5.5.270.0030.07720.85
5.5.260.0170.07020.95
5.5.250.0070.05720.54
5.5.240.0030.06020.11
5.4.450.0300.06019.46
5.4.440.0870.06719.51
5.4.430.0270.04019.30
5.4.420.0200.04719.31
5.4.410.0130.05019.15
5.4.400.0000.06019.00
5.4.390.0070.06019.26
5.4.380.0070.05718.96
5.4.370.0170.06319.00
5.4.360.0070.05719.16
5.4.350.0100.05318.97
5.4.340.0100.05319.06
5.4.320.0130.05019.00
5.4.310.0270.05319.16
5.4.300.0030.06019.00
5.4.290.0130.07019.25
5.4.280.0130.05019.16
5.4.270.0070.05319.05
5.4.260.0070.05719.16
5.4.250.0100.05318.91
5.4.240.0030.06018.97
5.4.230.0200.04318.90
5.4.220.0170.05718.94
5.4.210.0200.04019.04
5.4.200.0030.05316.51
5.4.190.0100.05019.24
5.4.180.0030.05719.14
5.4.170.0070.05718.94
5.4.160.0030.05718.94
5.4.150.0130.05019.23
5.4.140.0130.05016.54
5.4.130.0170.04316.57
5.4.120.0070.05016.52
5.4.110.0100.04716.52
5.4.100.0000.06316.54
5.4.90.0100.05316.50
5.4.80.0230.03716.41
5.4.70.0070.05316.51
5.4.60.0070.05016.11
5.4.50.0130.05016.20
5.4.40.0200.04316.39
5.4.30.0200.04016.53
5.4.20.0100.06716.30
5.4.10.0100.05716.20
5.4.00.0070.05015.82
5.3.290.0100.05014.69
5.3.280.0100.05714.63
5.3.270.0030.06014.61
5.3.260.0130.05014.57
5.3.250.0130.05014.55
5.3.240.0070.05314.61
5.3.230.0230.05014.56
5.3.220.0130.05314.57
5.3.210.0070.06014.37
5.3.200.0070.05314.45
5.3.190.0100.05314.58
5.3.180.0070.05014.51
5.3.170.0070.05014.47
5.3.160.0070.05314.46
5.3.150.0070.05714.59
5.3.140.0170.04314.49
5.3.130.0230.03714.45
5.3.120.0000.06014.46
5.3.110.0130.05014.46
5.3.100.0130.04713.94
5.3.90.0130.05013.97
5.3.80.0130.04713.93
5.3.70.0100.05013.89
5.3.60.0070.05313.94
5.3.50.0030.05713.86
5.3.40.0130.04713.96
5.3.30.0200.04013.93
5.3.20.0130.04313.74
5.3.10.0000.05313.59
5.3.00.0100.04713.51
5.2.170.0030.05011.26
5.2.160.0200.03011.07
5.2.150.0030.04711.08
5.2.140.0030.04711.08
5.2.130.0070.04011.02
5.2.120.0030.04711.01
5.2.110.0100.03710.90
5.2.100.0000.04711.07
5.2.90.0070.04011.05
5.2.80.0100.03711.11
5.2.70.0070.05311.21
5.2.60.0170.04010.98
5.2.50.0170.04710.89
5.2.40.0100.05011.11
5.2.30.0070.05310.89
5.2.20.0100.04710.98
5.2.10.0170.04010.80
5.2.00.0100.05310.66
5.1.60.0030.03710.07
5.1.50.0100.04010.18
5.1.40.0030.0509.91
5.1.30.0000.04710.35
5.1.20.0100.03310.23
5.1.10.0100.03710.19
5.1.00.0000.04010.08
5.0.50.0070.0278.49
5.0.40.0030.0278.36
5.0.30.0000.0478.09
5.0.20.0030.0308.21
5.0.10.0030.0308.12
5.0.00.0000.0478.32
4.4.90.0070.0205.79
4.4.80.0000.0235.92
4.4.70.0000.0235.76
4.4.60.0030.0235.86
4.4.50.0030.0205.80
4.4.40.0000.0405.82
4.4.30.0000.0305.76
4.4.20.0030.0235.83
4.4.10.0000.0235.88
4.4.00.0000.0375.82
4.3.110.0000.0235.87
4.3.100.0070.0175.81
4.3.90.0000.0235.69
4.3.80.0000.0375.67
4.3.70.0030.0205.79
4.3.60.0000.0235.80
4.3.50.0000.0235.80
4.3.40.0030.0335.65
4.3.30.0070.0204.47
4.3.20.0070.0234.42
4.3.10.0000.0274.40
4.3.00.0100.0237.06