PHP-Parser is both an executable binary that can be run, and a library that can be used in Rust programs.

Installing bench_file bench_tree_sitter compare compare_corpus compare_tokens corpus_test debug_file php-parser tree_sitter_parse executables

Assuming you have Rust/Cargo installed, run this command in a terminal:

cargo install php-parser

It will make bench_file bench_tree_sitter compare compare_corpus compare_tokens corpus_test debug_file php-parser tree_sitter_parse commands available in your PATH if you've allowed the PATH to be modified when installing Rust. cargo uninstall php-parser uninstalls.

Adding php_parser library as a dependency

Run this command in a terminal, in your project's directory:

cargo add php-parser

To add it manually, edit your project's Cargo.toml file and add to the [dependencies] section:

php-parser = "0.1.3"

The php_parser library will be automatically available globally.

Back to the crate overview.