3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = NULL; $aaa = 'aaa_one,aaa_two,aaa_three,aaa_four'; $bbb = 'bbb_one,bbb_two,bbb_three,bbb_four'; $ccc = 'ccc_one,ccc_two,ccc_three,ccc_four'; $data["AAA"] = explode(",", $aaa) ; $data["BBB"] = explode(",", $bbb) ; $data["CCC"] = explode(",", $ccc) ; foreach ($data["AAA"] as $key => $value) { echo "{$key} => {$value} "; echo "$values \n"; } print("\n\n"); echo($data["BBB"][1]);print("\n\n"); print_r( $data );
based on b5Yk7
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
0 => aaa_one Notice: Undefined variable: values in /in/5sUl7 on line 14 1 => aaa_two Notice: Undefined variable: values in /in/5sUl7 on line 14 2 => aaa_three Notice: Undefined variable: values in /in/5sUl7 on line 14 3 => aaa_four Notice: Undefined variable: values in /in/5sUl7 on line 14 bbb_two Array ( [AAA] => Array ( [0] => aaa_one [1] => aaa_two [2] => aaa_three [3] => aaa_four ) [BBB] => Array ( [0] => bbb_one [1] => bbb_two [2] => bbb_three [3] => bbb_four ) [CCC] => Array ( [0] => ccc_one [1] => ccc_two [2] => ccc_three [3] => ccc_four ) )