3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['a', 'b', 'c', 'd', 'e']; function customReverse($array) { $reversedArray = []; $count = count($array); for ($i = 0; $i < count($array); $i++) { $reversedArray[] = $i % 2 === 0 ? $array[$i / 2] : $array[$count - ($i / 2)]; } return $reversedArray; } print_r(customReverse($array));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Implicit conversion from float 4.5 to int loses precision in /in/LjRJD on line 9 Deprecated: Implicit conversion from float 3.5 to int loses precision in /in/LjRJD on line 9 Array ( [0] => a [1] => e [2] => b [3] => d [4] => c )

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:
135.51 ms | 406 KiB | 5 Q