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 ofjson_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
- ubuntu stonking: php-parser 5.8.0-2build2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms