3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = [ 0 => [ 'id' => 123-456-000-000, 'name' => 'john' ], 1 => [ 'id' => 123-456-789-014, 'name' => 'james' ] ]; $arr1 = [ 0 => [ 'id' => 123-456-000-000, 'address' => 'Japan' ], 1 => [ 'id' => 123-456-789-014, 'address' => 'Spain' ] ]; foreach ($arr1 as $key => $inner) { $arr1[$key]["address"] = $inner["address"]; } print_r(arr1);
Output for 7.2.0
Warning: Use of undefined constant arr1 - assumed 'arr1' (this will throw an Error in a future version of PHP) in /in/N781T on line 32 arr1
Output for 5.4.10 - 7.1.10
Notice: Use of undefined constant arr1 - assumed 'arr1' in /in/N781T on line 32 arr1
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/N781T on line 3
Process exited with code 255.