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 ); ?>
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> int(99) [1]=> int(100) }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
62.4 ms | 401 KiB | 8 Q