PHP Parser

Software Screenshot:
PHP Parser
Software Details:
Version: 2.0.1 updated
Upload Date: 10 Apr 16
Developer: Nikita Popov
Distribution Type: Freeware
Downloads: 17

Rating: 4.0/5 (Total Votes: 1)

The PHP Parser library was written for the purpose of code analysis.

It simply reads the code and shows it as an array of the syntax tree.

By manipulating the array we can also manipulate the code.

For beginners, documentation is provided with the project.

What is new in this release:

  • String parts of encapsed strings are now represented using `Scalar\EncapsStringPart` nodes. Previously raw strings were used. This affects the `parts` child of `Scalar\Encaps` and `Expr\ShellExec`. The change has been done to allow assignment of attributes to encapsed string parts.

What is new in version 2.0.0:

  • String parts of encapsed strings are now represented using `Scalar\EncapsStringPart` nodes. Previously raw strings were used. This affects the `parts` child of `Scalar\Encaps` and `Expr\ShellExec`. The change has been done to allow assignment of attributes to encapsed string parts.

What is new in version 1.4.0 / 2.0.0-alpha1:

  • The `NameResolver` now resolves parameter type hints when entering the function/method/closure node. As such other visitors running after it will be able to make use of the resolved names at that point already.
  • The autoloader no longer sets the `unserialize_callback_func` ini option on registration - this is not necessary and may cause issues when running PhpUnit tests with process isolation.

What is new in version 1.3.0:

  • The `NameResolver` now resolves parameter type hints when entering the function/method/closure node. As such other visitors running after it will be able to make use of the resolved names at that point already.
  • The autoloader no longer sets the `unserialize_callback_func` ini option on registration - this is not necessary and may cause issues when running PhpUnit tests with process isolation.

What is new in version 1.2.2:

  • The `NameResolver` now resolves parameter type hints when entering the function/method/closure node. As such other visitors running after it will be able to make use of the resolved names at that point already.
  • The autoloader no longer sets the `unserialize_callback_func` ini option on registration - this is not necessary and may cause issues when running PhpUnit tests with process isolation.

What is new in version 1.1.0:

  • Node visitors can now return `NodeTraverser::DONT_TRAVERSE_CHILDREN` from `enterNode()` in order to skip all children of the current node, for all visitors.
  • Declaring a property as abstract or final is now an error.
  • Added builders for traits and namespaces.
  • The class, interface, trait, function, method and property builders now support adding doc comments using the `setDocComment()` method.
  • Added support for fully-qualified and namespace-relative names in builders. No longer allow use of name component arrays.
  • Do not add documentation and tests to distribution archive files.

What is new in version 1.0.1:

  • Disallow new expressions without a class name. Previously new; was accidentally considered to be valid code.
  • Support T_ONUMBER token used by HHVM.
  • Added ability to directly pass code to the php-parse.php script.
  • Prevent truncation of var_dump() output in the php-parse.php script if XDebug is used.

What is new in version 1.0.0:

  • Removed deprecated `Template` and `TemplateLoader` classes.
  • Fixed XML unserializer to properly work with new namespaced node names.

What is new in version 0.9.4:

  • There now is a builder for interfaces (`PHPParser_Builder_Interface`).
  • An interface for the node traversation has been added: `PHPParser_NodeTraverserInterface`
  • Fixed pretty printing of `include` expressions (precedence information was missing).
  • Fixed "undefined index" notices when generating the expected tokens for a syntax error.

What is new in version 0.9.3:

  • Added support for arbitrary expressions in empty().
  • Added support for constant array / string dereferencing.
  • Added support for yield expressions. This adds a new Yield expression type, with subnodes key and value.
  • Added support for finally. This adds a new finallyStmts subnode to the TryCatch node. If there is no finally clause it will be null.

What is new in version 0.9.2:

  • Added Class->getMethods() function, which returns all methods contained in the stmts array of the class node. This does not take inherited methods into account.
  • Added isPublic(), isProtected(), isPrivate(). isAbstract(), isFinal() and isStatic() accessors to the ClassMethod, Property and Class nodes. (Property and Class obviously only have the accessors relevant to them.)
  • Fixed parsing of new expressions in parentheses, e.g. return(new Foo);.
  • Added mechanism for adding attributes to nodes in the lexer.
  • Fixed NameResolver visitor to also resolve class names in catch blocks.

Requirements:

  • PHP 5.4 or higher

Limitations:

  • Still in development. Might change drastically from one version to the other.

Similar Software

way.js
way.js

1 Mar 15

Ambient.js
Ambient.js

12 Apr 15

YAJET
YAJET

6 Jun 15

Comments to PHP Parser

Comments not found
Add Comment
Turn on images!