I just noticed the following behavior in my php code and I'm wondering why it's happening.
$array = array();
test_value($array['invalid_index']); // Error -> Notice: Undefined index: invalid_index in ...
test_reference($array['invalid_index']); //No error
function test_value($value){}
function test_reference(&$value){}
I was expecting both test_value
and test_reference
to throw the undefined index error but strangely the method by reference doesn't throw any error.
Why?