declare(strict_types=1);
$a = ['foo' => true];
echo $a['b'];
PHP Warning: Undefined array key "b" in php shell code on line 3
Warning: Undefined array key "b" in php shell code on line 3
but warning in VS Code is another, not really helpful:
[{
"resource": "Untitled-88",
"owner": "generated_diagnostic_collection_name#5",
"code": "PHP0406",
"severity": 4,
"message": "Argument '1' passed to echo() is expected to be of type string, bool given",
"source": "PHP",
"startLineNumber": 4,
"startColumn": 6,
"endLineNumber": 4,
"endColumn": 13,
"origin": "extHost1"
}]
Without strict there is even "no problem", no warning.