3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numeric_tests = array( 'test1' => array( '11', '22', '33', '44' ), 'test2' => array( '44', '55', '66', '77' ) ); $assoc_tests = array( 'test1' => array( '11' => '11', '22' => '22', '33' => '33', '44' => '44' ), 'test2' => array( '44' => '44', '55' => '55', '66' => '66', '77' => '77' ) ); $numeric_concat = array(); $numeric_merge = array(); foreach( $numeric_tests as $test ) { $numeric_concat += $test; $numeric_merge = array_merge( $numeric_merge, $test ); } $assoc_concat = array(); $assoc_merge = array(); foreach( $assoc_tests as $test ) { $assoc_concat += array_flip( $test ); $assoc_merge = array_merge( $assoc_merge, $test ); } print_r($numeric_concat); print_r($numeric_merge); print_r($assoc_concat); print_r($assoc_merge);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 11 [1] => 22 [2] => 33 [3] => 44 ) Array ( [0] => 11 [1] => 22 [2] => 33 [3] => 44 [4] => 44 [5] => 55 [6] => 66 [7] => 77 ) Array ( [11] => 11 [22] => 22 [33] => 33 [44] => 44 [55] => 55 [66] => 66 [77] => 77 ) Array ( [0] => 11 [1] => 22 [2] => 33 [3] => 44 [4] => 44 [5] => 55 [6] => 66 [7] => 77 )

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:
38.88 ms | 402 KiB | 8 Q