carthage-software/mago
Mago is an extremely fast PHP linter, formatter, and static analyzer written in Rust. It brings Rust-inspired speed and reliability to PHP projects with a modern toolchain and great developer experience, plus multiple install options (script, Homebrew, Composer).
At the heart of Mago lies its high-performance, resilient lexer and parser. These are the foundational components that turn your raw PHP source code into a structured representation that all of Mago's other tools can understand.
OpenTag, LiteralString, Whitespace).While these components are mostly used internally, Mago exposes them through the mago ast command. This is an incredibly powerful tool for:
If you're building your own tools in Rust and need a high-performance PHP parser, you can use Mago's core crates directly:
mago-syntax: the crate containing the lexer, parser, and all AST node definitions, along with utilities for working with the AST.mago-names: the crate for resolving symbol names (e.g., turning a local class name into its fully qualified name).mago ast command and its flags.How can I help you explore Laravel packages today?