방금 PHP 코드에서 다음과 같은 동작을 발견했습니다. 왜 그런 일이 벌어지고 있는지 궁금합니다.PHP - 참조로 전달하면 정의되지 않은 인덱스 오류가 표시되지 않습니까?
$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){}
나는 정의되지 않은 인덱스 오류를 던져하지만 이상하게 기준에 의한 방법은 오류가 발생하지 않습니다 모두 test_value
및 test_reference
을 기다리고 있었다.
왜?