PHP_Reflect User Guide

Overview of the project, its contents, and how to get started with your reflexion

This guide documents the final stable version 1.9.0

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 Install Guide if it’s your first use with PHP_Reflect.

PHP_Reflect may be installed in several ways, choose your favorite.

See our tutorial to learn how to get started with your first reflexion.