3v4l.org

run code in 300+ PHP versions simultaneously
<?php $oldarray = [0=>'a',8=>'b',2=>'c',7=>'d',9=>'e',11=>'f']; $newarray = array(); $length = count($oldarray); for($i = 0; $i < $length ; ++$i) { $newarray[] = array('current'=>current($oldarray),'next'=>next($oldarray)); } print_r($newarray);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [current] => a [next] => b ) [1] => Array ( [current] => b [next] => c ) [2] => Array ( [current] => c [next] => d ) [3] => Array ( [current] => d [next] => e ) [4] => Array ( [current] => e [next] => f ) [5] => Array ( [current] => f [next] => ) )

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:
27.99 ms | 407 KiB | 5 Q