3v4l.org

run code in 300+ PHP versions simultaneously
<?php function _flatten_array($arr) { while ($arr) { list($key, $value) = each($arr); is_array($value) ? $arr = $value : $out[$key] = $value; unset($arr[$key]); } return (array)$out; } $aNonFlat = array( 1, 2, array( 3, 4, 5, array( 6, 7 ), 8, 9, ), 10, 11 ); var_export(_flatten_array($$aNonFlat));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Array to string conversion in /in/X0aeS on line 28 Warning: Undefined variable $Array in /in/X0aeS on line 28 Warning: Undefined variable $out in /in/X0aeS on line 8 array ( )

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