The best way is to edit the VsCode settings.json and specify it for the PHP language.
You can open it typing VsCode command:
Preferences: open settings (JSON)
And specify inside the “editor.wordSeparators” setting for your language removing the ‘$’ symbol:
"[php]": {
"editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?"
}