3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = Array ( [rpiid] => Array ( [1] => 86 ) [sensor_id] => Array ( [1] => 1 ) [when] => Array ( [1] => 2014-02-24 ) [val] => Array ( [1] => 000 ) [train] => Array ( [1] => True ) [valid] => Array ( [1] => False ) [button] => update ); foreach($a as $key => $value){ $new_array[$key] = $value[0]; } var_dump($new_array);
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '[', expecting ')' in /in/l0H5n on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '[', expecting ')' in /in/l0H5n on line 5
Process exited with code 255.

preferences:
188.24 ms | 1395 KiB | 62 Q