3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Pagination { public $current_page; public $per_page; public $total_count; public $pages_articles; public function __construct($page=1, $per_page=20, $total_count=0) { $this->current_page = (int)$page; $this->per_page = (int)$per_page; $this->total_count = (int)$total_count; $this->pages_articles=array( '<div class="article-loop"><img src="http://i.imgur.com/CmU3tnl.jpg"></div>', '<div class="article-loop"><img src="http://i.imgur.com/TDdxS9H.png"></div>', '<div class="article-loop"><img src="http://i.imgur.com/39rpmwB.jpg"></div>', '<div class="article-loop"><img src="http://i.imgur.com/1lBZQ1B.png"></div>', '<div class="article-loop"><img src="https://i.imgur.com/Y5Ld4Qfh.jpg"></div>', '<div class="article-loop"><img src="http://i.imgur.com/8HumESY.jpg"></div>', '<div class="article-loop"><img src="http://i.imgur.com/CqCZBvk.png"></div>', '<div class="article-loop"><img src="http://i.imgur.com/wQVPRVp.png"></div>'); } public function offset() { return ($this->current_page - 1) * $this->per_page; } public function total_pages() { //$this->total_count=sizeof($this->pages_articles); return ceil($this->total_count/$this->per_page); } public function previous_page() { return $this->current_page - 1; } public function next_page() { return $this->current_page + 1; } public function has_previous_page() { return $this->previous_page() >= 1 ? true : false; } public function has_next_page() { return $this->next_page() <= $this->total_pages() ? true : false; } } $page = !empty($_GET['page']) ? (int)$_GET['page'] : 1; $per_page = 3; $total_count=8; $pagination = new Pagination($page, $per_page, $total_count); ?> <html> <body> <div> <?php $i = $pagination->offset() ; $limit = $pagination->per_page; while($i<$pagination->total_count && $limit>0) { echo $pagination->pages_articles[$i]."<br>"; $i++; $limit--; } ?> </div> <ul> <?php if($pagination->has_previous_page()) { echo '<li style="display:inline"><a href="index.php?page='.$pagination->previous_page().'">&laquo;</a></li>'; } else { echo '<li style="display:inline" class="disabled"><a href="#">&laquo;</a></li>'; } for($i=1; $i<=$pagination->total_pages(); $i++) { echo '<a href="index.php?page='.$i.'"><li style="display:inline; margin-left:5px; margin-right:5px">'.$i.'</li></a>'; } if($pagination->has_next_page()) { echo '<li style="display:inline"><a href="index.php?page='.$pagination->next_page().'">&raquo;</a></li>'; } else { echo '<li style="display:inline" class="disabled"><a href="#">&raquo;</a></li>'; } ?> </ul> </body> </html>

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.0060.00918.43
8.3.50.0110.00716.29
8.3.40.0140.00318.93
8.3.30.0110.00418.85
8.3.20.0080.00021.05
8.3.10.0080.00022.04
8.3.00.0080.00019.54
8.2.180.0070.00725.92
8.2.170.0090.00922.96
8.2.160.0110.00721.14
8.2.150.0070.00025.66
8.2.140.0030.00524.66
8.2.130.0080.00022.18
8.2.120.0040.00426.35
8.2.110.0060.00321.09
8.2.100.0090.00317.81
8.2.90.0040.00418.03
8.2.80.0040.00419.14
8.2.70.0060.00317.50
8.2.60.0080.00017.63
8.2.50.0000.00817.75
8.2.40.0030.00619.48
8.2.30.0040.00421.07
8.2.20.0000.00818.24
8.2.10.0000.00718.29
8.2.00.0000.00718.10
8.1.280.0080.00825.92
8.1.270.0050.00224.04
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0070.00723.61
8.1.230.0060.00621.02
8.1.220.0050.00317.77
8.1.210.0030.00518.77
8.1.200.0040.00417.46
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0030.00617.65
8.1.160.0040.00418.91
8.1.150.0040.00420.73
8.1.140.0030.00619.68
8.1.130.0000.00718.99
8.1.120.0000.00717.58
8.1.110.0080.00017.43
8.1.100.0000.00717.55
8.1.90.0040.00417.54
8.1.80.0040.00417.49
8.1.70.0070.00317.43
8.1.60.0040.00417.64
8.1.50.0040.00417.65
8.1.40.0030.00617.66
8.1.30.0040.00417.77
8.1.20.0000.00717.80
8.1.10.0030.00517.72
8.1.00.0000.00817.62
8.0.300.0040.00420.02
8.0.290.0000.00816.88
8.0.280.0060.00318.59
8.0.270.0080.00016.94
8.0.260.0000.00716.95
8.0.250.0000.00717.01
8.0.240.0040.00416.93
8.0.230.0030.00316.95
8.0.220.0070.00017.06
8.0.210.0040.00416.93
8.0.200.0030.00317.09
8.0.190.0060.00317.09
8.0.180.0000.00717.09
8.0.170.0070.00017.04
8.0.160.0000.00816.98
8.0.150.0030.00716.96
8.0.140.0030.00316.84
8.0.130.0000.00813.44
8.0.120.0050.00316.93
8.0.110.0040.00416.85
8.0.100.0000.00816.87
8.0.90.0040.00417.09
8.0.80.0090.00617.04
8.0.70.0040.00416.89
8.0.60.0040.00416.80
8.0.50.0000.00717.06
8.0.30.0140.00517.14
8.0.20.0110.00817.40
8.0.10.0000.00816.99
8.0.00.0130.00616.80
7.4.330.0000.00515.55
7.4.320.0040.00416.71
7.4.300.0000.00616.75
7.4.290.0000.00716.66
7.4.280.0000.00716.60
7.4.270.0000.00816.70
7.4.260.0050.00316.66
7.4.250.0030.00516.56
7.4.240.0040.00416.63
7.4.230.0000.00716.79
7.4.220.0140.01516.73
7.4.210.0100.00416.57
7.4.200.0070.00016.72
7.4.160.0090.00916.58
7.4.150.0060.01217.40
7.4.140.0150.00617.86
7.4.130.0030.01516.66
7.4.120.0080.01316.64
7.4.110.0070.01716.68
7.4.100.0030.01416.69
7.4.90.0030.01316.70
7.4.80.0120.00619.39
7.4.70.0040.01816.62
7.4.60.0080.00816.54
7.4.50.0090.00616.68
7.4.40.0090.00916.48
7.4.30.0130.00916.68
7.4.10.0030.01415.19
7.4.00.0100.00615.07
7.3.330.0030.00313.49
7.3.320.0050.00013.25
7.3.310.0000.00716.47
7.3.300.0030.00316.48
7.3.290.0070.00916.37
7.3.280.0080.00916.35
7.3.270.0070.01017.40
7.3.260.0100.00616.51
7.3.250.0090.01216.47
7.3.240.0130.00916.50
7.3.230.0070.01116.47
7.3.210.0090.00916.53
7.3.200.0040.01516.60
7.3.190.0110.00716.56
7.3.180.0160.00016.50
7.3.170.0060.01616.45
7.3.160.0150.00816.41
7.3.130.0130.00315.10
7.3.120.0060.01014.73
7.3.110.0060.00914.62
7.3.100.0020.01114.97
7.3.90.0060.01014.98
7.3.80.0030.01014.68
7.3.70.0030.00714.95
7.3.60.0060.00815.02
7.3.50.0080.00614.85
7.3.40.0050.00714.86
7.3.30.0050.00814.65
7.3.20.0080.00616.78
7.3.10.0050.00816.83
7.3.00.0080.00516.46
7.2.330.0130.00616.77
7.2.320.0110.01316.82
7.2.310.0070.01016.94
7.2.300.0070.01416.92
7.2.290.0130.00416.79
7.2.260.0060.01015.19
7.2.250.0070.01115.15
7.2.240.0130.00515.21
7.2.230.0080.00915.20
7.2.220.0070.01015.14
7.2.210.0060.00915.24
7.2.200.0020.01015.13
7.2.190.0030.01415.06
7.2.180.0070.00715.15
7.2.170.0070.00715.04
7.2.160.0040.01115.09
7.2.150.0040.01116.85
7.2.140.0030.00716.67
7.2.130.0040.01117.01
7.2.120.0000.01617.12
7.2.110.0070.00316.60
7.2.100.0030.00716.95
7.2.90.0090.00616.86
7.2.80.0070.00716.86
7.2.70.0030.01017.16
7.2.60.0050.00916.93
7.2.50.0080.00816.87
7.2.40.0030.01016.83
7.2.30.0100.00717.13
7.2.20.0070.00717.05
7.2.10.0090.00616.99
7.2.00.0030.01617.03
7.1.330.0030.01115.78
7.1.320.0070.00815.94
7.1.310.0050.01215.76
7.1.300.0050.01015.98
7.1.290.0080.00315.70
7.1.280.0040.00915.66
7.1.270.0060.00915.92
7.1.260.0060.00315.83
7.1.250.0030.01215.85
7.1.240.0100.00315.88
7.1.230.0090.00915.94
7.1.220.0070.00715.74
7.1.210.0100.00015.46
7.1.200.0060.00616.00
7.1.190.0060.00615.90
7.1.180.0060.00615.64
7.1.170.0000.01315.71
7.1.160.0030.00615.85
7.1.150.0030.01315.81
7.1.140.0000.01015.82
7.1.130.0060.01315.79
7.1.120.0030.00615.81
7.1.110.0000.01215.59
7.1.100.0040.01115.85
7.1.90.0030.01015.77
7.1.80.0060.00615.55
7.1.70.0030.00616.47
7.1.60.0520.01524.53
7.1.50.0820.00724.40
7.1.40.0590.01124.29
7.1.30.0750.00324.35
7.1.20.0470.01524.34
7.1.10.0380.01115.44
7.1.00.0530.01115.24
7.0.330.0090.00615.30
7.0.320.0000.00815.13
7.0.310.0000.00815.47
7.0.300.0100.00315.33
7.0.290.0030.01315.25
7.0.280.0040.00815.45
7.0.270.0100.00315.64
7.0.260.0080.00315.44
7.0.250.0050.00515.48
7.0.240.0000.01115.63
7.0.230.0070.00415.26
7.0.220.0040.00715.46
7.0.210.0000.01015.31
7.0.200.0640.00715.25
7.0.190.0580.00515.27
7.0.180.0560.00314.99
7.0.170.0670.00815.07
7.0.160.0330.01214.98
7.0.150.0410.00815.02
7.0.140.0680.01015.15
7.0.130.0450.01115.00
7.0.120.0800.01315.20
7.0.110.0570.01114.99
7.0.100.0530.00914.87
7.0.90.0500.01014.96
7.0.80.0590.00715.08
7.0.70.0480.00814.90
7.0.60.0820.01014.77
7.0.50.0070.00715.05
7.0.40.0050.01114.19
7.0.30.0050.01213.86
7.0.20.0280.01214.17
7.0.10.0460.01014.15
7.0.00.0060.01114.07
5.6.400.0120.00314.65
5.6.390.0090.01014.47
5.6.380.0040.00714.29
5.6.370.0030.00614.66
5.6.360.0050.00814.64
5.6.350.0060.00914.32
5.6.340.0100.00314.24
5.6.330.0130.00314.25
5.6.320.0090.00614.64
5.6.310.0040.00814.45
5.6.300.0100.00714.53
5.6.290.0000.01114.25
5.6.280.0090.00314.40
5.6.270.0090.00314.25
5.6.260.0160.00014.53
5.6.250.0000.01014.44
5.6.240.0070.00714.41
5.6.230.0100.00314.26
5.6.220.0030.00814.54
5.6.210.0090.00614.38
5.6.200.0060.00614.61
5.6.190.0090.00014.18
5.6.180.0060.00614.68
5.6.170.0110.00414.34
5.6.160.0030.01014.31
5.6.150.0110.00314.38
5.6.140.0080.00014.63
5.6.130.0140.00014.60
5.6.120.0060.01014.56
5.6.110.0060.00714.46
5.6.100.0030.00714.47
5.6.90.0030.01014.10
5.6.80.0030.00914.44
5.6.70.0100.00314.25
5.6.60.0030.01014.27
5.6.50.0070.00714.28
5.6.40.0040.00814.26
5.6.30.0000.01614.46
5.6.20.0000.01414.27
5.6.10.0000.01514.65
5.6.00.0000.01114.23

preferences:
65.2 ms | 400 KiB | 5 Q