A fast, lightweight PHP language server written in Rust. Ready in seconds, uses a fraction of the RAM other language servers need, and stays responsive throughout. No indexing phase, no waiting.
[!NOTE] PHPantom is in active development. The core editing features are solid and used daily on production codebases.
PHPantom focuses on deep type intelligence. Here's how it compares:
| PHPantom | Intelephense | PHP Tools | Phpactor | PHPStorm | |
|---|---|---|---|---|---|
| Common LSP features1 | ✅ | ✅ | ✅ | ✅ | ✅ |
| Workspace symbols | 🚧 | ✅ | ✅ | ✅ | ✅ |
| Semantic tokens | ✅ | ❌ | ✅ | ❌ | ✅ |
| Linked editing | ✅ | ❌ | ✅ | ❌ | ✅ |
| Extras2 | ✅ | 💰 | 🚧 | 🚧 | ✅ |
| Diagnostics | |||||
| PHPStan integration | ✅ | ❌ | ❌ | 🚧 | 🚧 |
| Undefined variable | ✅ | 💰 | ✅ | ✅ | ✅ |
| Type errors | ✅ | 💰 | ✅ | 🚧 | ✅ |
| Unused variable | ✅ | ❌ | ✅ | ❌ | ✅ |
| Type Intelligence | |||||
Generics / @template |
✅ | 🚧 | ✅ | 🚧 | ✅ |
@mixin completion |
✅ | 💰 | ✅ | ✅ | 🚧 |
| Array / object shapes | ✅ | ✅ | ✅ | 🚧 | 🚧 |
| PHPStan types | ✅ | ❌ | 🚧 | 🚧 | 🚧 |
| Conditional return types | ✅ | ❌ | ✅ | 🚧 | ❌ |
| Closure parameter inference | ✅ | 🚧 | 🚧 | 🚧 | ❌ |
| Laravel | ✅ | ❌ | 🚧 | ❌ | 🧩 |
| Refactoring | |||||
| Rename | ✅ | 💰 | 💰 | ✅ | ✅ |
| Common refactorings3 | ✅ | ❌ | 💰 | ✅ | ✅ |
| Extract constant | ✅ | ❌ | ❌ | ✅ | ✅ |
| Promote constructor parameter | ✅ | ❌ | ❌ | ❌ | ✅ |
| Simplify expressions | ✅ | ❌ | 💰 | ❌ | ✅ |
| Performance | |||||
| Time to ready | < 1 s | 1 min 25 s | 3 min 17 s | 15 min 39 s | 19 min 38 s |
| RAM usage | 59 MB | 520 MB | 3.9 GB | 498 MB | 2.0 GB |
| Disk cache | 0 | 45 MB | 0 | 4.1 GB | 551 MB |
🚧 = partial support. 🧩 = requires plugin. 💰 = paid tier.
1 Completion, hover, signature help, go-to-definition, find references, diagnostics, document symbols.
2 Auto-import, go-to implementation / type-definition, smart select, folding ranges, formatting, code lens, inlay hints, type hierarchy, document links.
3 Implement interface methods, extract method/function, extract/inline variable, generate constructor, generate getter/setter.
Performance measured on a production codebase: 21K PHP files, 1.5M lines of code (vendor + application).
Want to verify? Open
examples/demo.phpin your editor and trigger completion at the marked locations. It exercises every type intelligence feature in the table, including edge cases where tools diverge. For Laravel specifically, openexamples/laravel/— a standalone project with real Eloquent models, config, routes, views, and translations that exercises Eloquent property resolution, query builder chaining, scopes, custom collections, and go-to-definition for config keys, route names, and translation strings.
@throws detects uncaught exceptions in the method body, @param pre-fills from the signature, and tags are filtered to context and never suggested twice.array_map preserve element types.$users->map(fn($u) => $u->name) infers $u as User from the collection's generic context.@return types resolve to the concrete branch at each call site.@phpstan-type, @phpstan-import-type, and object{...} shapes all resolve through to completions.@deprecated detection, and namespace segment drilling.PHPantom understands Composer projects out of the box, but works without setup on non-Composer projects too:
autoload_classmap.php and autoload_files.php.composer.json, resolves the web root, and indexes Drupal-specific directories and PHP extensions (.module, .install, .theme, etc.) with .gitignore bypassed so that Composer-managed core and contrib code is always available.require_once discovery. Functions from required files are available for completion.analyze), automated fixes (fix), and CI integration.PHPantom stands on the shoulders of:
@phpstan-* annotations.MIT. See LICENSE.
$ claude mcp add phpantom_lsp \
-- python -m otcore.mcp_server <graph>