PHPackages                             vineg/php-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. vineg/php-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

vineg/php-parser
================

A PHP parser written in PHP

v0.9.4(12y ago)013BSD-3-ClausePHPPHP &gt;=5.2

Since Jan 5Pushed 12y ago1 watchersCompare

[ Source](https://github.com/Vineg/PHP-Parser)[ Packagist](https://packagist.org/packages/vineg/php-parser)[ RSS](/packages/vineg-php-parser/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (7)Used By (0)

PHP Parser
==========

[](#php-parser)

This is a PHP 5.5 (and older) parser written in PHP. It's purpose is to simplify static code analysis and manipulation.

Documentation can be found in the [`doc/`](https://github.com/nikic/PHP-Parser/tree/master/doc) directory.

***Note: This project is experimental, so the API is subject to change.***

In a Nutshell
-------------

[](#in-a-nutshell)

Basically, the parser does nothing more than turn some PHP code into an abstract syntax tree. ("nothing more" is kind of sarcastic here as PHP has a ... uhm, let's just say "not nice" ... grammar, which makes parsing PHP very hard.)

For example, if you stick this code in the parser:

```
