Home / Downloads / Documentation / Source code

XRef: PHP source code toolkit

XRef is a development tool for PHP language. If you write in PHP and want to make your code better, it's for you.

PHP is a language where errors are hard to spot. Misspelled variable names? Code block moved out of context during refactoring? You name it.

Lint from XRef package does this job - finds errors in PHP source code. From simple online tool to continuous integration service for big teams.

Online lint: check your code here

Copy your source PHP code (including the opening tag <?php) in the form below:

Install command-line tools

Need to check many files? Not ready to send your source code outside of your box? Install XRef locally.

From source code from github:

git clone git@github.com:gariev/xref.git /home/you/xref
export PATH=$PATH:/home/you/xref/bin

or use standard PHP PEAR package manager:

pear channel-discover pear.xref-lint.net
pear install xref/XRef

Run it:

xref-lint --help

Or, if you are using git, check modified files before commit:

git xref-lint

Setup continuous integration server

Working in a big team with git repository? Don't want to install XRef to every developer's box? Run XRef as continous integration tool. In essence, it will check each commit to repository and report about errors in modified files.

Your project is being developed for a long time? Not enough resources to fix errors before running continuous integration? Don't worry - turn "incremental" reporting mode on and get notification about new errors only. See documentation for details.