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
Fatal error: Uncaught Error: Call to undefined function each() in /in/7cO9N:4 Stack trace: #0 /in/7cO9N(28): _flatten_array(Array) #1 {main} thrown in /in/7cO9N on line 4
Process exited with code 255.

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