3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = array( 'a' => array('1' => 2, '2' => 3), 'b' => array('4' => 5, '5' => 6)); print_r($x); foreach ($x as $k => $v){ if (isset($v['1'])) {$x[$k]['1'] = 10; } } print_r($x);
based on T7hFI
Output for 4.3.0 - 7.2.0
Array ( [a] => Array ( [1] => 2 [2] => 3 ) [b] => Array ( [4] => 5 [5] => 6 ) ) Array ( [a] => Array ( [1] => 10 [2] => 3 ) [b] => Array ( [4] => 5 [5] => 6 ) )