PHP-PARSE(1)

πŸ’… NAME πŸ’…

php-parse β€” the command line interface for PHP Parser, bestie. It's a page in the User Commands section of the manual (section 1, iykyk).


✨ SYNOPSIS ✨

php-parse [operations] file1.php [file2.php ...]
php-parse [operations] "<?php code"

Like, you can hand it actual .php files, or you can just scream a PHP snippet at it in quotes. Both work. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the whole vibe: it takes your PHP source code and turns it into an abstract syntax tree. That's it, that's the job. Your code goes in 🌸, a big beautiful tree of nodes comes out πŸ‘‘.

And operations? That's just a list of the options down below, and if you don't pick any, --dump is what you get by default. No thoughts, just dumping. πŸ’€


πŸŽ€ OPTIONS πŸŽ€

  • -d, --dump β€” Dumps the nodes using NodeDumper. The classic, the default, the moment. ✨
  • -p, --pretty-print β€” Pretty prints the file using PrettyPrinter\Standard. Yes bestie, it makes it PRETTY. πŸ’…
  • -j, --json-dump β€” Prints the result of json_encode(). For when you want your AST in JSON form, no cap. 🌈
  • --var-dump β€” var_dump()s the nodes, for that exact structure. Every type, every key, every crumb. πŸ”
  • -N, --resolve-names β€” Resolves names using NodeVisitor\NameResolver. Names? Resolved. Periodt. πŸ’œ
  • -c, --with-column-info β€” Shows column numbers for errors (if available, so like, don't come for it if they're not πŸ™ˆ).
  • -P, --with-positions β€” Shows positions in node dumps. Everything has a place and it's showing you where. πŸ“
  • -r, --with-recovery β€” Uses parsing with error recovery. It's giving resilience, it's giving "we move." 🧚
  • --version=VERSION β€” Target a specific PHP version. Default is newest, because we stay current obviously. ⭐
  • -h, --help β€” Displays this page. Hi, you're here, iconic. πŸ₯°

🌸 Example: 🌸

php-parse -d -p -N -d file.php

Okay so read it with me: it Dumps nodes, pretty prints them, then resolves names and dumps them again. Four things, one command, main character energy. πŸ”₯


and that's the whole page, bestie!! πŸ’– This gorgeousness is from php-parse version 5.8.0, dated July 2026, and it lives in the PHP-PARSE(1) manual. Slay, bye!! πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from