3v4l.org

run code in 300+ PHP versions simultaneously
<?php // simulate the array $arr = [0=>'a',8=>'b',2=>'c',7=>'d',9=>'e',11=>'f']; // iterate it without messing with its internal pointer for($i=0;$i<count($arr);$i++) $arr[key($arr)] = ["current" => current($arr), "next" => next($arr)]; // test it print_r($arr);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [current] => a [next] => b ) [8] => Array ( [current] => b [next] => c ) [2] => Array ( [current] => c [next] => d ) [7] => Array ( [current] => d [next] => e ) [9] => Array ( [current] => e [next] => f ) [11] => 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:
162.75 ms | 407 KiB | 5 Q