3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* http://3v4l.org/DCTnA */ /* < [1] 2 3 ... 22 23 > < 1 [2] 3 ... 22 23 > < 1 2 [3] 4 ... 22 23 > < 1 2 3 [4] 5 ... 22 23 > < 1 2 ... 4 [5] 6 ... 22 23 > < 1 2 ... 5 [6] 7 ... 22 23 > ... < 1 2 ... 18 [19] 20 ... 22 23 > */ $currentpageid = $nmstart = 2; $nrtotal = 23; $nrposts = 1; $pages = ''; $ssPagingStartCount = 3; $ssPagingCurrentCount = 3; $ssPagingEndCount = 2; $totalpages = ceil($nrtotal / $nrposts); if ($totalpages > 1 ){ /* for ($x = 0; $x < $totalpages; ++$x) { $inc = $x * $nrposts; $display = $x + 1; if($inc != $nmstart) { $pages .= "\n<a class=\"nl_page\" href='" . "nmstart=$inc'>".$display."</a>"; } else { $pages .= "\n<span class=\"nl_page nl_page__currentpage\">".$display."</span>"; } } */ if ( ($currentpageid >= 0) && ($currentpageid < $ssPagingStartCount) ) { for ($x = 0; (($x = max($ssPagingStartCount, ($currentpageid + (int)($ssPagingCurrentCount/2)))) && ($x < $totalpages)); ++$x) { $inc = $x * $nrposts; $display = $x + 1; if ($inc != $nmstart) { $pages .= "\n<a class=\"nl_page\" href='" . "nmstart=$inc'>".$display."</a>"; } else { $pages .= "\n<span class=\"nl_page nl_page__currentpage\">".$display."</span>"; } } } } var_dump($pages); ?>

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.1000.16749.97
8.3.60.0730.18650.30
8.3.50.0890.18950.08
8.3.40.0490.08536.39
8.3.30.0400.08336.42
8.3.20.0240.05837.75
8.3.10.0300.04739.52
8.3.00.0190.05535.33
8.2.190.0400.20850.20
8.2.180.1080.20249.84
8.2.170.0390.11136.38
8.2.160.0520.08538.04
8.2.150.0170.05736.28
8.2.140.0270.04036.50
8.2.130.0430.03338.01
8.2.120.0290.04235.65
8.2.110.0360.06938.29
8.2.100.0370.08135.37
8.2.90.0130.08238.07
8.2.80.0230.07336.79
8.2.70.0200.08635.39
8.2.60.0230.10035.46
8.2.50.0140.09034.99
8.2.40.0200.09735.88
8.2.30.0140.08835.71
8.2.20.0170.08735.33
8.2.10.0130.07935.72
8.2.00.0160.07535.33
8.1.280.0590.20149.80
8.1.270.0320.04236.86
8.1.260.0330.04037.80
8.1.250.0260.04639.88
8.1.240.0230.07838.64
8.1.230.0370.07038.39
8.1.220.0230.08535.10
8.1.210.0160.07936.27
8.1.200.0200.08334.84
8.1.190.0370.09134.52
8.1.180.0230.09734.94
8.1.170.0200.08536.18
8.1.160.0130.07439.48
8.1.150.0130.08136.42
8.1.140.0070.08834.96
8.1.130.0070.08335.40
8.1.120.0140.08134.90
8.1.110.0100.08335.00
8.1.100.0070.08434.86
8.1.90.0100.08535.00
8.1.80.0070.08535.02
8.1.70.0100.08334.93
8.1.60.0170.08135.08
8.1.50.0100.08735.04
8.1.40.0170.08235.05
8.1.30.0130.08235.00
8.1.20.0170.08035.11
8.1.10.0430.16950.91
8.1.00.0240.18150.83
8.0.300.0560.15953.45
8.0.290.0330.19149.93
8.0.280.0170.18451.86
8.0.270.0330.19750.69
8.0.260.0230.18050.65
8.0.250.0230.18350.37
8.0.240.0270.16750.41
8.0.230.0230.18150.25
8.0.220.0260.17150.19
8.0.210.0270.17350.24
8.0.200.0170.18150.31
8.0.190.0460.16250.31
8.0.180.0200.18150.29
8.0.170.0270.18350.33
8.0.160.0230.17150.35
8.0.150.0100.19650.13
8.0.140.0130.18850.18
8.0.130.0530.37678.80
8.0.120.0230.18750.21
8.0.110.0240.17950.28
8.0.100.0170.19350.29
8.0.90.0240.18150.17
8.0.80.0700.26050.19
8.0.70.0360.16850.23
8.0.60.0300.16750.06
8.0.50.0300.16850.25
8.0.30.1010.41250.48
8.0.20.0990.27650.35
8.0.10.0230.17750.46
8.0.00.0920.29850.19
7.4.330.0070.18046.95
7.4.320.0170.17649.87
7.4.300.0430.18849.92
7.4.290.0230.18049.84
7.4.280.0300.17749.92
7.4.270.0200.17649.96
7.4.260.0300.16749.91
7.4.250.0160.18549.72
7.4.240.0220.17349.82
7.4.230.0170.18149.93
7.4.220.0790.28549.80
7.4.210.0850.21649.80
7.4.200.0370.16150.00
7.4.160.1080.27649.78
7.4.150.0990.27249.68
7.4.140.1120.36649.88
7.4.130.0900.31149.93
7.4.120.0880.27049.82
7.4.110.0760.26749.95
7.4.100.1030.43149.89
7.4.90.0960.24749.99
7.4.80.0760.30249.89
7.4.70.0630.31049.75
7.4.60.0450.26849.91
7.4.50.0100.15849.98
7.4.40.0670.26749.73
7.4.30.0760.27949.74
7.4.00.0430.32148.19
7.3.330.0730.38278.56
7.3.320.3050.53078.75
7.3.310.0230.18849.61
7.3.300.0260.18449.69
7.3.290.0500.29149.70
7.3.280.0810.34549.71
7.3.270.0890.27649.84
7.3.260.0930.28449.76
7.3.250.0990.30949.94
7.3.240.0700.36650.01
7.3.230.0890.29849.68
7.3.210.0670.28249.85
7.3.200.0700.28850.01
7.3.190.0850.26049.96
7.3.180.1020.40050.05
7.3.170.0820.32849.80
7.3.160.0880.27450.02
7.3.120.0600.33247.88
7.3.110.0300.27448.02
7.3.100.0230.31348.25
7.3.90.0360.37548.30
7.3.80.0300.36848.27
7.3.70.0440.28248.14
7.3.60.0400.40747.99
7.3.50.0270.28347.98
7.3.40.0300.26448.35
7.3.30.0400.27548.15
7.3.20.0300.29548.37
7.3.10.0370.27548.46
7.3.00.0290.26748.66
7.2.330.0940.27249.98
7.2.320.0830.53750.22
7.2.310.0850.27749.95
7.2.300.0940.30649.98
7.2.290.0720.29050.27
7.2.250.0270.44948.52
7.2.240.0470.43348.59
7.2.230.0330.34548.13
7.2.220.0430.32348.15
7.2.210.0430.38348.50
7.2.200.0270.37448.57
7.2.190.0270.38048.56
7.2.180.0170.28448.25
7.2.170.0300.40448.61
7.2.60.1260.17948.92
7.2.00.0170.19051.14
7.1.330.0200.59647.63
7.1.320.0300.52547.77
7.1.310.0270.59847.52
7.1.300.0170.58747.70
7.1.290.0230.47247.73
7.1.280.0300.58347.43
7.1.270.0300.55247.52
7.1.260.0500.52447.75
7.1.200.0570.20847.55
7.1.100.1040.29249.96
7.1.70.0030.22349.16
7.1.60.0330.23449.12
7.1.50.0270.26249.13
7.1.00.0130.35054.24
7.0.200.6560.28248.91
7.0.140.0130.22753.97
7.0.71.2570.22053.48
7.0.60.0270.31353.34
7.0.50.0300.32351.36
7.0.40.0300.28049.66
7.0.30.0600.32349.91
7.0.20.0730.31049.82
7.0.10.0800.30349.77
7.0.00.0370.31049.72
5.6.280.0230.83384.75
5.6.210.0300.80784.31
5.6.200.0100.77781.89
5.6.190.0130.78084.14
5.6.180.0330.82384.10
5.6.170.0370.81384.12
5.6.160.0170.78784.10
5.6.150.0100.82381.68
5.6.140.0300.82781.80
5.6.130.0230.82081.88
5.6.120.0200.87384.64
5.6.110.0270.82784.83
5.6.100.0270.82385.52
5.6.90.0330.77384.72
5.6.80.0270.86384.10
5.6.70.0530.78784.18
5.5.350.0270.78084.16
5.5.340.0300.75081.74
5.5.330.0600.79784.54
5.5.320.0370.82383.92
5.5.310.0470.81083.81
5.5.300.2030.74781.71
5.5.290.0200.76381.55
5.5.280.0400.83784.73
5.5.270.0230.81384.43
5.5.260.0170.79784.63
5.5.250.0170.86084.54
5.5.240.0230.74783.99
5.4.450.0400.83083.04
5.4.440.0630.78082.79
5.4.430.0370.75783.22
5.4.420.0300.81083.04
5.4.410.0400.80782.94
5.4.400.0631.40782.53
5.4.390.0701.28782.20
5.4.380.1431.37082.69
5.4.370.1401.28382.40
5.4.360.0571.40782.43
5.4.350.0371.21082.27
5.4.340.0571.37082.27
5.4.320.0801.19382.42
5.4.310.1431.21382.29
5.4.300.1131.14782.44
5.4.290.1131.30382.26
5.4.280.1201.44082.26
5.4.270.1431.15782.40
5.4.260.1201.25782.24
5.4.250.1401.16082.32
5.4.240.1231.28083.13
5.4.230.1201.31082.45
5.4.220.1031.17382.40
5.4.210.1071.27082.41
5.4.200.1231.33080.19
5.4.190.0971.10782.39
5.4.180.1201.32082.26
5.4.170.1371.29782.44
5.4.160.1071.24082.25
5.4.150.1231.11782.22
5.4.140.1201.25379.92
5.4.130.1201.25079.96
5.4.120.1131.36379.79
5.4.110.1071.44379.80
5.4.100.1371.36379.97
5.4.90.1371.19780.04
5.4.80.1331.19079.76
5.4.70.1131.26380.07
5.4.60.1301.27379.84
5.4.50.1431.13380.02
5.4.40.1231.35380.02
5.4.30.1071.21079.91
5.4.20.0931.27379.88
5.4.10.1501.14380.02

preferences:
20.96 ms | 401 KiB | 5 Q