Static analysis for PHP


Within the documentation of PHP-front the TheExampleProject is used to explain how you can setup your own project. This documentation uses PHP-Tools as the running example. Although it is used in the documentation the package actually builds and provides real-life tools.

PHP-Tools is growing to be a package with useful tools for analyzing PHP-projects. All of the tools will be able to answer a single question. The following list of tools is available:

  • defined-functions ; which functions are defined outside the scope of a class? (since revision 396)
  • input-vector ; Which entries in the input arrays are being accessed within the project?
  • test-migration ; Are there any static problems with migrating my code to PHP5? (since revision 406) (More info)
  • php-cyco ; What is the cyclomatic complexity of me PHP-script? (since revision 421) (More info)

Yes, this list is to be extended.


Latest Developments

Distributions of the head revision are created continuously:


The distributions contain the latest of the latest developments, but if you really want to, the latest sources can be checked out using:

  svn checkout
Before you can configure the package as described above you have to run the ./bootstrap script.


Install the package with the usual sequence of commands:

$ ./configure
$ make
$ make install

You might need to set your PKG_CONFIG_PATH if you did not install the dependencies in a standard location. Configure will tell you to do this if it cannot find aterm, sdf or strategoxt.

Project Info

Issue Tracking

We use JIRA to keep track of issues. Please report any issues that you encounter!

Contact and Mailing List

You can either ask question about the project on the MailingList or swing by on #stratego on irc://

Source Repository

The sources of php-tools are available from Subversion.



PHP-Tools is LGPL (GNU Lesser General Public License) software.