3v4l.org

run code in 300+ PHP versions simultaneously
<?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 ); ?>

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)
8.3.70.0090.00618.27
8.3.60.0100.00718.52
8.3.50.0070.01122.06
8.3.40.0170.00318.89
8.3.30.0110.00418.96
8.3.20.0050.00220.34
8.3.10.0050.00223.48
8.3.00.0060.00320.90
8.2.190.0080.01116.63
8.2.180.0150.00416.38
8.2.170.0070.00722.96
8.2.160.0000.01320.48
8.2.150.0050.00224.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.23
8.2.110.0030.00622.19
8.2.100.0120.00019.25
8.2.90.0040.00419.17
8.2.80.0080.00019.16
8.2.70.0000.00817.38
8.2.60.0060.00317.80
8.2.50.0030.00618.07
8.2.40.0070.00418.22
8.2.30.0040.00417.98
8.2.20.0000.00817.61
8.2.10.0040.00419.90
8.2.00.0040.00417.92
8.1.280.0120.00325.92
8.1.270.0000.00820.33
8.1.260.0070.00026.35
8.1.250.0000.00728.09
8.1.240.0030.00623.92
8.1.230.0040.00719.08
8.1.220.0000.00817.76
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0030.00617.53
8.1.180.0000.00720.17
8.1.170.0080.00018.62
8.1.160.0000.00722.01
8.1.150.0000.00718.74
8.1.140.0000.00717.37
8.1.130.0030.00317.80
8.1.120.0000.00817.32
8.1.110.0040.00417.29
8.1.100.0040.00417.27
8.1.90.0000.00717.39
8.1.80.0070.00017.27
8.1.70.0030.00317.28
8.1.60.0060.00317.45
8.1.50.0030.00517.35
8.1.40.0030.00617.46
8.1.30.0030.00517.60
8.1.20.0000.00717.59
8.1.10.0000.00717.39
8.1.00.0030.00617.44
8.0.300.0040.00418.77
8.0.290.0000.00917.18
8.0.280.0030.00518.26
8.0.270.0000.00717.18
8.0.260.0030.00316.73
8.0.250.0000.00616.91
8.0.240.0030.00316.81
8.0.230.0040.00416.82
8.0.220.0070.00016.71
8.0.210.0000.00716.78
8.0.200.0060.00016.82
8.0.190.0080.00416.92
8.0.180.0040.00416.92
8.0.170.0080.00016.75
8.0.160.0040.00416.72
8.0.150.0030.00416.72
8.0.140.0000.00716.80
8.0.130.0000.00513.24
8.0.120.0030.00616.75
8.0.110.0000.00716.79
8.0.100.0080.00016.76
8.0.90.0040.00416.66
8.0.80.0090.00916.82
8.0.70.0070.00016.75
8.0.60.0040.00416.93
8.0.50.0040.00416.88
8.0.30.0050.01516.89
8.0.20.0150.00417.40
8.0.10.0000.00816.97
8.0.00.0100.00716.63
7.4.330.0030.00315.03
7.4.320.0030.00316.44
7.4.300.0030.00316.34
7.4.290.0000.00716.52
7.4.280.0030.00516.43
7.4.270.0000.00616.49
7.4.260.0080.00016.42
7.4.250.0040.00416.48
7.4.240.0060.00216.41
7.4.230.0040.00416.28
7.4.220.0230.01316.43
7.4.210.0070.01016.46
7.4.200.0030.00316.60
7.4.160.0110.00516.61
7.4.150.0070.01117.40
7.4.140.0100.00817.86
7.4.130.0120.00516.31
7.4.120.0090.00816.35
7.4.110.0130.00316.38
7.4.100.0090.01516.45
7.4.90.0070.01016.41
7.4.80.0120.00619.39
7.4.70.0130.00516.37
7.4.60.0070.01016.37
7.4.50.0000.00816.41
7.4.40.0120.00516.27
7.4.30.0080.00816.36
7.4.00.0060.01015.09
7.3.330.0030.00312.95
7.3.320.0030.00313.04
7.3.310.0000.00716.13
7.3.300.0060.00016.21
7.3.290.0030.00316.20
7.3.280.0080.00916.26
7.3.270.0110.00617.40
7.3.260.0070.01016.42
7.3.250.0090.01216.25
7.3.240.0080.00816.27
7.3.230.0120.00916.39
7.3.210.0030.01516.30
7.3.200.0000.01716.55
7.3.190.0060.01316.59
7.3.180.0060.01016.27
7.3.170.0120.00416.39
7.3.160.0120.00316.21
7.3.10.0040.01116.49
7.3.00.0030.01316.31
7.2.330.0030.01416.57
7.2.320.0100.00716.68
7.2.310.0140.00316.64
7.2.300.0070.01116.47
7.2.290.0130.00416.48
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

preferences:
35.25 ms | 401 KiB | 5 Q