declare(strict_types=1);
const consta = ['foo' => true];
echo consta['bar'];
Of course, "PHP Warning: Undefined array key "bar" in php shell code on line 3
Warning: Undefined array key "bar" in php shell code on line 3"
Editor sees no problem. I'd assume a warning in "Problems" to access undefined index.