3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Enter your code here, enjoy! $array = array(); $array[] = array("foo" => 111, "bar" => 444); $array[] = array("foo" => 222, "bar" => 555); $array[] = array("foo" => 333, "bar" => 777); $array2 = array(); $array2[] = array('foobar' => 888, 'barfoo'=>999); $array2[] = array('barfoo' => 999, 'barfoo'=>1010); $array2[] = array('barfoo' => 1111, 'barfoo'=>1212); foreach( $array as $key=>$value){ echo $key."\t=>\t".$value['foo']."..."."\n"; } $array = array_merge[$array, $array2]; //echo var_dump($array);
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.28, 5.4.0 - 5.4.26
Parse error: syntax error, unexpected '[' in /in/INdrs on line 20
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/INdrs on line 20
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/INdrs on line 20
Process exited with code 255.

preferences:
206.58 ms | 1395 KiB | 116 Q