3v4l.org

run code in 300+ PHP versions simultaneously
<?php function flatten(array $nestedArraysAndStrings){ $flat=[]; $iter = new RecursiveIteratorIterator( new RecursiveArrayIterator($nestedArraysAndStrings)); foreach($iter as $leaf){ $flat[] = $leaf; } return join(NULL, $flat); } $noRefs = [[[['some']]],[' nested ']," items n"]; $withRefs = []+$noRefs; $wat = $noRefs[0]; $withRefs[0] = &$wat; echo flatten($noRefs); echo flatten($withRefs);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: join(): Passing null to parameter #1 ($separator) of type array|string is deprecated in /in/up3me on line 8 some nested items n Deprecated: join(): Passing null to parameter #1 ($separator) of type array|string is deprecated in /in/up3me on line 8 some nested items n

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