Thanks Marco — I agree that any official LSP should follow the PHP spec
closely and avoid adding new type semantics.
The issue isn’t the lack of servers, but fragmentation. Psalm and Phpactor
differ in scope and design, while Phan’s LSP docs haven’t been updated in
years and its Vim plugin is around seven years old. None are standardized
or maintained alongside PHP itself.
PhpStorm is an excellent IDE, but it’s premium — and the fact it’s the only
consistently recommended option highlights a tooling gap. Developers using
VS Code, Neovim, Emacs, or Sublime Text often get a very different
experience.
The Language Server Protocol exists to solve exactly this: as Tom Djenius
de Vries put it, it turns the M×N problem (M editors × N languages) into
M+N — each only needs one integration point.
A spec-aligned, officially maintained PHP LSP could unify that baseline and
make PHP development more consistent and accessible across editors.
Best,
Dan
Hello everyone,
I’d like to start a discussion about the potential for PHP to have an
official Language Server, implementing the Language Server Protocol (LSP) —
similar to what other programming languages already provide (e.g. Go’s
gopls, Elixir’s Expert, etc.).Just reporting on existing language servers that already exist, and go way
ahead of PHP in terms of supported type declarations.
https://github.com/vimeo/psalm/blob/2b0ff73c8bed091af231a0a80ac109126c92083a/docs/running_psalm/language_server.md
*
https://github.com/phpactor/language-server/blob/e4934195cc1857ec3347a488f3357b0f0df2d2bf/README.md
*
https://github.com/phan/phan/blob/5c25c548b2fb3755e5a01f320dfd96dcd19d850b/README.md#featuresNote that the PHP spec is quite limited on more refined types (like
int<1, max>and such, as an example), so I wouldn't expect an "official"
LSP to support it.Marco Pivetta
Thanks Marco — I agree that any official LSP should follow the PHP spec closely and avoid adding new type semantics.The issue isn’t the lack of servers, but fragmentation. Psalm and Phpactor differ in scope and design, while Phan’s LSP docs haven’t been updated in years and its Vim plugin is around seven years old. None are standardized or maintained alongside PHP itself.
PhpStorm is an excellent IDE, but it’s premium — and the fact it’s the only consistently recommended option highlights a tooling gap. Developers using VS Code, Neovim, Emacs, or Sublime Text often get a very different experience.
The Language Server Protocol exists to solve exactly this: as Tom Djenius de Vries put it, it turns the M×N problem (M editors × N languages) into M+N — each only needs one integration point.
A spec-aligned, officially maintained PHP LSP could unify that baseline and make PHP development more consistent and accessible across editors.
IMO, this is something that would work best as a working group involving the maintainers of PHPStan, Psalm, PHP CodeSniffer, PhpStorm, and the related VS Code extensions, since all of these projects have an interest in a spec-aligned PHP LSP. Perhaps PHP-FIG could be a good host for this working group?
Cheers,
Ben