Discover Packages
github.com/wudi/php-parser
examples
basic-parsing
command
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Sep 3, 2025
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: ? modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
Basic Parsing Example
This example demonstrates how to use the PHP parser to parse PHP code and examine the resulting AST.
What it does
Takes a sample PHP code string containing variables, functions, and classes
Creates a lexer and parser instance
Parses the code into an Abstract Syntax Tree (AST)
Displays basic information about the parsed statements
Shows the full AST structure
Running the example
cd examples/basic-parsing
go run main.go
Expected output
The program will display:
Number of parsed statements
A list of each statement type
The complete AST structure in string format
This is the foundation for more complex PHP code analysis tasks.
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.