3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$arr = array(1,2,3,4,5,6,7,8,9,0); $arr = array(1,2,3,4,5,6,7,8,9,0); $i = 0; $links_count = 4; $s = array(); while ($item = current($arr)) { $s[] = "<a href='#'>$item</a>\n"; next($arr); } var_dump(array_chunk($s, 4)); echo $s;
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> array(4) { [0]=> string(18) "<a href='#'>1</a> " [1]=> string(18) "<a href='#'>2</a> " [2]=> string(18) "<a href='#'>3</a> " [3]=> string(18) "<a href='#'>4</a> " } [1]=> array(4) { [0]=> string(18) "<a href='#'>5</a> " [1]=> string(18) "<a href='#'>6</a> " [2]=> string(18) "<a href='#'>7</a> " [3]=> string(18) "<a href='#'>8</a> " } [2]=> array(1) { [0]=> string(18) "<a href='#'>9</a> " } } Warning: Array to string conversion in /in/6Pt01 on line 19 Array

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:
42.59 ms | 402 KiB | 8 Q