I am working on an older codebase. When I set intelephense with the following in .vscode/settings.json
:
{
"intelephense.environment.phpVersion": "5.3",
"[php]": {
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
}
}
... then I know it is working because in one place in my code it warns me that I am using excessively modern syntax (it reads "PHP 5.4+ syntax found. Targeting PHP 5.3.0.intelephense (1022)").
However, when I try to use mysql_pconnect
in the same codebase, it complains "Undefined function 'mysql_pconnect'. intelephense(1010)".
But this function was only deprecated as of php 5.5. Is there a way to fix this?
The stubs in the extension are disabled by default since April 2019:
Removed mysql from default stubs (can be reenabled by adding mysql to intelephense.stubs setting)
You can find the directive in Visual Studio Code settings searching by "stubs" in the "intelephense" section.