3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arrayFlat($arr){ $out = ''; foreach($arr as $key => $value){ if(!is_array($value)){ $out .= $value.','; }else{ $out .= $key.','; $out .= arrayFlat($value); } } return trim($out,','); } $aNonFlat = array( 1, 2, array( 3, 4, 5, array( 6, 7 ), 8, 9, ), 10, 11 ); $result = explode(',',arrayFlat($aNonFlat)); echo '<pre>'; print_r($result); echo '</pre>';
Output for git.master_jit, git.master, rfc.property-hooks
<pre>Array ( [0] => 1 [1] => 2 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 3 [7] => 6 [8] => 78 [9] => 910 [10] => 11 ) </pre>

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