Skip to content

Commit 1b2d518

Browse files
committed
Mention php-parser-to-php-ast project in README
1 parent 6827989 commit 1b2d518

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,14 @@ of consequences:
611611
retrieving it from a package manager, on Windows by loading a DLL. PHP-Parser is installed as a
612612
Composer dependency.
613613
* php-ast only runs on PHP >= 7.0, as prior versions did not use an internal AST. PHP-Parser
614-
supports PHP >= 5.4.
614+
supports PHP >= 5.5.
615615
* php-ast may only parse code that is syntactically valid on the version of PHP it runs on. This
616616
means that it's not possible to parse code using features of newer versions (e.g. PHP 7.1 code
617617
while running on PHP 7.0). Similarly, it is not possible to parse code that is no longer
618618
syntactically valid on the used version (e.g. some PHP 5 code may no longer be parsed -- however
619619
most code will work). PHP-Parser supports parsing both newer and older (up to PHP 5.2) versions.
620+
* php-ast can only parse code which is syntactically valid, while PHP-Parser can provide a partial
621+
AST for code that contains errors (e.g., because it is currently being edited).
620622
* php-ast only provides the starting line number (and for declarations the ending line number) of
621623
nodes, because this is the only part that PHP itself stores. PHP-Parser provides precise file
622624
offsets.
@@ -641,8 +643,14 @@ There are a number of differences in the AST representation and available suppor
641643
* AST traversation / visitation: There is currently no standalone package for this either, but
642644
implementing a recursive AST walk is easy.
643645

646+
The [php-parser-to-php-ast][php-parser-to-php-ast] project can convert the AST produced by
647+
PHP-Parser into the format used by the php-ast extension. This can be used as a slow fallback in
648+
case the php-ast extension is not available. It may also be used to produce a partial php-ast output
649+
for code with syntax errors.
650+
644651
[parser]: http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_language_parser.y
645652
[util]: https://github.com/nikic/php-ast/blob/master/util.php
646653
[test_dump]: https://github.com/nikic/php-ast/blob/master/tests/001.phpt
647654
[php-parser]: https://github.com/nikic/PHP-Parser
648655
[php-ast-reverter]: https://github.com/tpunt/php-ast-reverter
656+
[php-parser-to-php-ast]: https://github.com/tysonandre/php-parser-to-php-ast

0 commit comments

Comments
 (0)