<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$array = [];
$var = 0;
echo $array['foo'];// shows error
echo $var['bar'];//does not show error !
(demo)
This code produces
Notice: Undefined index: foo in /in/WfqtZ on line 10
I'm sorry if this sounds ridicules, but why PHP does not show "Undefined index: bar" in this code ? bar
is obviously an undefined index, what makes PHP think that it is defined ?