PHPackages                             loganhenson/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. loganhenson/php-parser

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

loganhenson/php-parser
======================

A PHP parser written in PHP

4.0.3(9y ago)039BSD-3-ClausePHPPHP &gt;=5.6

Since Jan 5Pushed 9y agoCompare

[ Source](https://github.com/loganhenson/PHP-Parser)[ Packagist](https://packagist.org/packages/loganhenson/php-parser)[ RSS](/packages/loganhenson-php-parser/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (46)Used By (0)

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

[](#php-parser)

[![Build Status](https://camo.githubusercontent.com/562d1ac97634003a10d49a8d8122f96127318e8dd5f738ffb5c1a2159afd02de/68747470733a2f2f7472617669732d63692e6f72672f6e696b69632f5048502d5061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nikic/PHP-Parser) [![Coverage Status](https://camo.githubusercontent.com/5c74b7d687daeb9de09aaf1d94fbaf57286d372dd1aed827759f09ce44082914/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e696b69632f5048502d5061727365722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/nikic/PHP-Parser?branch=master)

This is a PHP 5.2 to PHP 7.1 parser written in PHP. Its purpose is to simplify static code analysis and manipulation.

[**Documentation for version 3.x**](https://github.com/nikic/PHP-Parser/tree/3.x/doc) (stable; for running on PHP &gt;= 5.5; for parsing PHP 5.2 to PHP 7.1).

[Documentation for version 2.x](https://github.com/nikic/PHP-Parser/tree/2.x/doc) (unsupported; for running on PHP &gt;= 5.4; for parsing PHP 5.2 to PHP 7.0).

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

[](#in-a-nutshell)

The parser turns PHP source code into an abstract syntax tree. For example, if you pass the following code into the parser:

```
