If you’re working on a project in Visul Studio Code where you use a specific PHP version, you can create the file .vscode/settings.json
and add the following to it:
{
"intelephense.environment.phpVersion": "7.2"
}
In this example, the language level will be at PHP 7.2 levels, and you PHP Intelephense will show syntax errors for newer syntax.