3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 0 => array( 0 => array( 'name' => 'test1', 'country' => 'abc' ), 1 => array( 'name' => 'test2', 'country' => 'xyz' ) ), 1 => array( 'name' => 'test3', 'country' => 'pqr' ), 2 => array( 0 => array( 'name' => 'test1', 'country' => 'abc' ), 1 => array( 'name' => 'test2', 'country' => 'xyz' ), 2 => array( 'name' => 'test1', 'country' => 'abc' ), 3 => array( 'name' => 'test2', 'country' => 'xyz' ) ), 3 => array( 'name' => 'test3', 'country' => 'pqr' ), ); $new = []; foreach($arr as $subarr){ $new = array_merge($new, $subarr); } var_dump($new);
Output for git.master, git.master_jit, rfc.property-hooks
array(8) { [0]=> array(2) { ["name"]=> string(5) "test1" ["country"]=> string(3) "abc" } [1]=> array(2) { ["name"]=> string(5) "test2" ["country"]=> string(3) "xyz" } ["name"]=> string(5) "test3" ["country"]=> string(3) "pqr" [2]=> array(2) { ["name"]=> string(5) "test1" ["country"]=> string(3) "abc" } [3]=> array(2) { ["name"]=> string(5) "test2" ["country"]=> string(3) "xyz" } [4]=> array(2) { ["name"]=> string(5) "test1" ["country"]=> string(3) "abc" } [5]=> array(2) { ["name"]=> string(5) "test2" ["country"]=> string(3) "xyz" } }

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:
27.1 ms | 407 KiB | 5 Q