如何为 PHP 8 设置 VS Code 扩展 Intelephense?

s3c*_*s3c 5 php laragon php-8 intelephense

我想将我购买的 Visual Studio Code 扩展设置为使用 PHP 8 版本,因为它的“intelisense”功能。

检查defaultSettings.json“intelephense”搜索查询会得到很多点击,但只有一个对我来说在升级到 PHP 8 时脱颖而出:

// A semver compatible string that represents the target PHP version. Used for providing version appropriate suggestions and diagnostics. PHP 5.3.0 and greater supported.
"intelephense.environment.phpVersion": "7.4.0",
Run Code Online (Sandbox Code Playgroud)

这可能应该在工作区设置中更改.vscode\settings.json

"intelephense.environment.phpVersion": "8.1.0-dev", // or would "8.0.0" be better?
Run Code Online (Sandbox Code Playgroud)

还有什么需要改变的吗?

我使用 Laragon 进行本地开发,安装了 PHP 7.2 和 8.0。登台和生产服务器使用 PHP 8.0。