3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(50,51,52,53,54,55,56,57,58,59); $odds = array(); $even = array(); foreach($array as $val) { if($val % 2 == 0) { $even[] = $val; } else { $odds[] = $val; } } rsort($odds); $array = array(); foreach($even as $key => $val) { $array[] = $val; if(isset($odds[$key])) { $array[] = $odds[$key]; } } var_dump($array);
Output for git.master_jit, git.master, rfc.property-hooks
array(10) { [0]=> int(50) [1]=> int(59) [2]=> int(52) [3]=> int(57) [4]=> int(54) [5]=> int(55) [6]=> int(56) [7]=> int(53) [8]=> int(58) [9]=> int(51) }

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:
110.08 ms | 401 KiB | 8 Q