matthiasnoback/php-ast-inspector

There is no license information available for the latest version (v0.4.0) of this package.

v0.4.0 2022-09-09 08:20 UTC

This package is auto-updated.

Last update: 2024-04-09 11:46:56 UTC


README

This package offers a command-line utility for parsing a PHP script and navigating the resulting Abstract Syntax Tree (AST), showing information about the nodes and highlighting the corresponding part of the original script.

Example output

Installation

composer require --dev matthiasnoback/php-ast-inspector

Usage

Run ast-inspect by pointing it at a script that you want to inspect, e.g. if your script is called file.php:

vendor/bin/ast-inspect inspect file.php

Now use the keys (a, s, d, w) to navigate the node tree. Quit using Ctrl + C.