PHP_Reflect

Reverse-engineer classes, interfaces, functions, constants, namespaces and more.

2013-10-12: PHP_Reflect 1.9.0 Released

Release highlights:

  • Fix one bug about trait detection.

  • Drop PHP 5.2 support.

Read the CHANGELOG for a full list of all additions, changes and bug fixes. Changes are documented in the updated User Guide. See the Installation page for downloads and installation instructions.

Laurent Laville

PHP_Reflect is a PHP Library that adds the ability to reverse-engineer classes, interfaces, functions, constants, namespaces and more.

Why PHP_Reflect is different to standard PHP5 Reflection API ?

With PHP5 Reflection API the code to analyze needs to be loaded and interpreted by the php interpreter, and in certain cases, this triggers fatal errors.

With PHP_Reflect you don’t have to trust in source code, because it will be parsed with tokenizer extension.

Features

  • ability to reverse-engineer classes

  • ability to reverse-engineer traits

  • ability to reverse-engineer interfaces

  • ability to reverse-engineer functions

  • ability to reverse-engineer constants

  • ability to reverse-engineer namespaces

  • ability to reverse-engineer includes

  • ability to reverse-engineer globals variables

  • uses containers that may be changed to store scanning results

  • select properties you want to retrieve (file, start and end lines, docblock, namespace …)

  • ability to extend the parsing level: connect user callbacks to handle more tokens

Requirements

Head to the PHP_Reflect User Guide available online for information or examples to get started.

The PHP_Reflect book is available in a selection of formats. You can download the documentation for offline reading.

Language Single HTML file Many HTML files HTML Help file PDF A4 file PDF US file EPUB file
English phpreflect-book.html.zip phpreflect-book.chunked.zip phpreflect-book.chm.zip phpreflect-book-a4.pdf phpreflect-book-us.pdf phpreflect-book.epub.zip

Changelog

You want to learn more about previous versions. Read the full changelog.

License

You are free to do whatever you want, even in a commercial environment. You are also encouraged to contribute. Read the full license.

Credits

Original author of PHPUnit/PHP_Token_Stream, that show me the way with his base concept to produce an extendable package .

https://github.com/sebastianbergmann/ Sebastian Bergmann

All pages of this site, and user guide were generated with AsciiDoc 8.6.8, assisted by FOP 1.0 (for PDFs). Automated build process uses Phing 2.6.1

Convert the HTML Help source (.hhp and .html) files to HTML Help (.chm) files using the Microsoft HTML Help Compiler.