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($arr3 ); ?>

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.60.0120.00418.18
8.3.50.0200.00221.93
8.3.40.0040.01118.40
8.3.30.0100.01018.96
8.3.20.0050.00320.16
8.3.10.0060.00323.61
8.3.00.0050.00320.96
8.2.180.0120.00916.32
8.2.170.0070.00718.82
8.2.160.0100.00322.96
8.2.150.0000.00825.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00819.36
8.2.110.0000.00922.21
8.2.100.0040.00719.21
8.2.90.0080.00019.23
8.2.80.0000.00719.34
8.2.70.0050.00317.50
8.2.60.0000.00917.89
8.2.50.0060.00318.07
8.2.40.0040.00418.03
8.2.30.0050.00317.93
8.2.20.0040.00417.69
8.2.10.0080.00019.84
8.2.00.0050.00318.11
8.1.280.0160.00625.92
8.1.270.0040.00420.29
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00323.88
8.1.230.0040.00819.07
8.1.220.0000.00917.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0040.00417.39
8.1.180.0040.00420.19
8.1.170.0040.00418.48
8.1.160.0000.00722.08
8.1.150.0040.00418.75
8.1.140.0040.00417.42
8.1.130.0000.00717.80
8.1.120.0040.00417.40
8.1.110.0040.00417.23
8.1.100.0040.00417.36
8.1.90.0040.00417.31
8.1.80.0000.00717.38
8.1.70.0000.00717.39
8.1.60.0030.00517.50
8.1.50.0030.00517.47
8.1.40.0030.00517.33
8.1.30.0080.00017.63
8.1.20.0080.00017.51
8.1.10.0040.00417.43
8.1.00.0000.00817.32
8.0.300.0070.00018.77
8.0.290.0050.00317.05
8.0.280.0000.00718.38
8.0.270.0070.00017.17
8.0.260.0000.00616.75
8.0.250.0000.00716.76
8.0.240.0030.00616.78
8.0.230.0030.00316.79
8.0.220.0020.00516.69
8.0.210.0000.00716.73
8.0.200.0060.00016.83
8.0.190.0090.00316.75
8.0.180.0040.00416.73
8.0.170.0050.00316.88
8.0.160.0000.00816.71
8.0.150.0040.00416.79
8.0.140.0030.00316.76
8.0.130.0050.00013.21
8.0.120.0040.00416.76
8.0.110.0050.00216.70
8.0.100.0030.00316.72
8.0.90.0000.00716.62
8.0.80.0120.00616.80
8.0.70.0050.00316.71
8.0.60.0040.00416.68
8.0.50.0030.00516.67
8.0.30.0150.00316.95
8.0.20.0080.01217.40
8.0.10.0000.00716.97
8.0.00.0090.01316.58
7.4.330.0050.00315.03
7.4.320.0030.00316.38
7.4.300.0000.00616.57
7.4.290.0020.00516.53
7.4.280.0040.00416.37
7.4.270.0070.00016.48
7.4.260.0000.00716.31
7.4.250.0040.00416.54
7.4.240.0030.00316.46
7.4.230.0030.00416.52
7.4.220.0040.02216.43
7.4.210.0060.01116.46
7.4.200.0000.00716.42
7.4.160.0110.00716.47
7.4.150.0160.00317.40
7.4.140.0090.01517.86
7.4.130.0130.00716.54
7.4.120.0120.01416.41
7.4.110.0130.00616.29
7.4.100.0130.01116.39
7.4.90.0060.01216.41
7.4.80.0180.00919.39
7.4.70.0030.01616.55
7.4.60.0070.01116.35
7.4.50.0040.00016.51
7.4.40.0100.01416.60
7.4.30.0170.00016.31
7.4.00.0040.01415.04
7.3.330.0030.00313.11
7.3.320.0000.00513.12
7.3.310.0000.00716.07
7.3.300.0000.00616.19
7.3.290.0040.00416.18
7.3.280.0100.01016.23
7.3.270.0130.00317.40
7.3.260.0130.01616.26
7.3.250.0070.01116.31
7.3.240.0090.00916.27
7.3.230.0100.00916.45
7.3.210.0100.01116.16
7.3.200.0100.01316.38
7.3.190.0060.01016.33
7.3.180.0100.00616.30
7.3.170.0060.01016.27
7.3.160.0110.00416.25
7.3.10.0080.00916.29
7.3.00.0090.00716.31
7.2.330.0030.01516.47
7.2.320.0110.01016.38
7.2.310.0030.01316.39
7.2.300.0060.01216.36
7.2.290.0130.01316.67
7.2.130.0040.01116.71
7.2.120.0070.01016.54
7.2.110.0100.00616.75
7.2.100.0050.01016.63
7.2.90.0060.00716.63
7.2.80.0030.00816.66
7.2.70.0030.00916.64
7.2.60.0090.00516.77
7.2.50.0070.00816.72
7.2.40.0060.00716.54
7.2.30.0040.00916.72
7.2.20.0080.00616.61
7.2.10.0080.00316.66
7.2.00.0070.00617.20
7.1.250.0060.00615.66
7.1.200.0040.00415.70
7.1.100.0060.00618.06
7.1.70.0020.00517.13
7.1.60.0060.01219.36
7.1.50.0110.01416.64
7.1.00.0000.08022.45
7.0.200.0030.00714.62
7.0.60.0100.06019.93
7.0.50.0000.06317.87
7.0.40.0100.07720.07
7.0.30.0500.03720.34
7.0.20.0200.08020.13
7.0.10.0070.04320.13
7.0.00.0000.04720.17
5.6.280.0000.07721.04
5.6.210.0200.07320.53
5.6.200.0170.07718.08
5.6.190.0070.04720.60
5.6.180.0300.07320.43
5.6.170.0230.08320.49
5.6.160.0130.08320.40
5.6.150.0030.05718.14
5.6.140.0070.08018.13
5.6.130.0330.05018.07
5.6.120.0030.05321.00
5.6.110.0070.08321.11
5.6.100.0070.07320.88
5.6.90.0130.08321.10
5.6.80.0130.06720.52
5.5.350.0030.08020.32
5.5.340.0130.07317.91
5.5.330.0070.08720.21
5.5.320.3230.04720.29
5.5.310.0400.06720.28
5.5.300.0100.07717.98
5.5.290.0100.08017.99
5.5.280.0130.07720.86
5.5.270.0070.04720.86
5.5.260.0030.04320.84
5.5.250.0130.07320.70
5.5.240.0070.07320.06
5.4.450.0000.04319.41
5.4.440.1170.04319.41
5.4.430.1730.05019.45
5.4.420.0030.06319.30
5.4.410.0030.06019.41
5.4.400.0100.05019.13
5.4.390.0070.05719.00
5.4.380.0070.05719.09
5.4.370.0130.05019.26
5.4.360.0030.05718.96
5.4.350.0070.05719.06
5.4.340.0030.06719.26
5.4.320.0130.05019.25
5.4.310.0100.05319.17
5.4.300.0170.04319.05
5.4.290.0070.05319.16
5.4.280.0100.05319.25
5.4.270.0170.04719.15
5.4.260.0100.05018.95
5.4.250.0100.05019.16
5.4.240.0030.06019.04
5.4.230.0100.05019.07
5.4.220.0070.05719.03
5.4.210.0030.05719.04
5.4.200.0100.05016.57
5.4.190.0130.04719.11
5.4.180.0130.04719.15
5.4.170.0070.05719.05
5.4.160.0170.04319.06
5.4.150.0100.05718.89
5.4.140.0100.05016.31
5.4.130.0070.05316.42
5.4.120.0100.04716.41
5.4.110.0030.05316.41
5.4.100.0030.05316.53
5.4.90.0000.05716.22
5.4.80.0100.04716.18
5.4.70.0130.04716.39
5.4.60.0100.05316.20
5.4.50.0170.04016.49
5.4.40.0170.04316.50
5.4.30.0070.05016.20
5.4.20.0100.05016.50
5.4.10.0100.05016.10
5.4.00.0030.05715.66
5.3.290.0100.05314.60
5.3.280.0070.05314.63
5.3.270.0030.06014.52
5.3.260.0070.06014.46
5.3.250.0130.05014.41
5.3.240.0130.04714.46
5.3.230.0070.05714.64
5.3.220.0100.05314.46
5.3.210.0100.05014.50
5.3.200.0030.05714.60
5.3.190.0170.05314.51
5.3.180.0100.04714.42
5.3.170.0100.06314.56
5.3.160.0100.04714.61
5.3.150.0200.04314.58
5.3.140.0100.05314.49
5.3.130.0070.05314.52
5.3.120.0030.05714.59
5.3.110.0100.05314.41
5.3.100.0000.06013.84
5.3.90.0070.05313.89
5.3.80.0100.06013.89
5.3.70.0030.05714.02
5.3.60.0130.04713.88
5.3.50.0000.05713.97
5.3.40.0130.04313.88
5.3.30.0130.05313.89
5.3.20.0070.05313.57
5.3.10.0100.06313.68
5.3.00.0130.04313.50
5.2.170.0030.04311.10
5.2.160.0070.04011.07
5.2.150.0100.04711.26
5.2.140.0070.04011.08
5.2.130.0030.04311.04
5.2.120.0100.04310.96
5.2.110.0030.04311.21
5.2.100.0130.03311.01
5.2.90.0030.04310.97
5.2.80.0100.04010.95
5.2.70.0030.05311.03
5.2.60.0100.03711.01
5.2.50.0070.04010.96
5.2.40.0170.03010.95
5.2.30.0170.03310.85
5.2.20.0030.04310.82
5.2.10.0170.03310.79
5.2.00.0100.03710.80
5.1.60.0130.04010.01
5.1.50.0130.03010.16
5.1.40.0030.0379.89
5.1.30.0030.03710.32
5.1.20.0030.04010.27
5.1.10.0070.03710.23
5.1.00.0100.0339.98
5.0.50.0030.0308.62
5.0.40.0070.0238.43
5.0.30.0000.0478.16
5.0.20.0070.0278.21
5.0.10.0130.0208.34
5.0.00.0000.0478.02
4.4.90.0100.0175.81
4.4.80.0070.0205.91
4.4.70.0000.0275.87
4.4.60.0030.0235.79
4.4.50.0130.0235.89
4.4.40.0030.0335.77
4.4.30.0030.0205.84
4.4.20.0070.0205.84
4.4.10.0070.0275.99
4.4.00.0030.0435.82
4.3.110.0000.0275.80
4.3.100.0030.0205.80
4.3.90.0100.0135.79
4.3.80.0030.0335.80
4.3.70.0000.0235.82
4.3.60.0070.0205.75
4.3.50.0070.0205.78
4.3.40.0100.0275.84
4.3.30.0070.0174.45
4.3.20.0030.0204.61
4.3.10.0100.0174.40
4.3.00.0300.01714.30

preferences:
58.14 ms | 401 KiB | 5 Q