3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_flatten($array, $keychain = '/') { $data = array(); foreach($array as $key=> $value) { if(is_array($value)) { $data = array_merge($data, array_flatten($value, $keychain.$key.'/')); } else { $data[$keychain.$key] = $value; } } return $data; } $array = array( array( 'foo' => 'bar', 'baz' => 'blah' ), array( 'foo' => 'bar', 'baz' => 'blah' ) ); var_dump(array_flatten($array));
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { ["/0/foo"]=> string(3) "bar" ["/0/baz"]=> string(4) "blah" ["/1/foo"]=> string(3) "bar" ["/1/baz"]=> string(4) "blah" }

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