1 2 3 4 5 6 7 8 9
<?php error_reporting(-1); $data = array('foo' => '42', 'bar'); echo $data['spinach']; echo $data[1]; print_r($data);
Notice: Undefined index: spinach in /t.php on line 6 Notice: Undefined offset: 1 in /t.php on line 7 Array ( [foo] => 42 [0] => bar )