3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cluster($array) { $array = array_reverse($array); foreach($array as $element) { $newarray = [$element=>$newarray]; } return $newarray; } var_dump(cluster(['A', 'B', 'C', 'D','E','F','G','H','I']));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $newarray in /in/OIqvH on line 5 array(1) { ["A"]=> array(1) { ["B"]=> array(1) { ["C"]=> array(1) { ["D"]=> array(1) { ["E"]=> array(1) { ["F"]=> array(1) { ["G"]=> array(1) { ["H"]=> array(1) { ["I"]=> NULL } } } } } } } } }

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