PHP Cross Reference Library

PHPCrossRef is an enhancement to PHPXref, a developer tool that’s designed to ease the process of working on large PHP projects by making it very fast and easy to browse the code documentation along with the code itself.

The Perl script works by scanning a project directory and translating the files it finds into readable cross-referenced HTML, simultaneously utilizing comments in the code to produce documentation to accompany it. The result is a collection of plain HTML files that can be read using any browser, with no supporting software required.


In January of 2006, with the approval of Gareth Watts, an online PHPXref cross-reference library was launched. Over time the online library amassed a total of 475 cross-referenced PHP projects. With 2.5 million cross-referenced library files and consuming 40 gigabytes of web server disk space, it became difficult to maintain.

Learning from this experience, work began a few years ago to streamline the generation of cross-references and to enhance the developer experience.


  • Generated HTML:
    • Smaller pages – faster browsing and reduced disk storage.
    • HTML pages conform to XHTML 1.0 Transitional.
    • Mobile browser friendly, more responsive design.
    • Print style sheet for removing unnecessary elements.
    • CSS and JavaScript minification using YUI Compressor.
  • Look and feel:
    • Aesthetically pleasing fonts, larger, easier on the eyes.
    • PHP source code viewing improved, syntax highlighting with colors.
    • Variables, functions, classes and constants pages redesigned.
    • Directory listings with lines, bytes, date and description columns.
    • Mime type icons from the Tango Desktop Project.
  • Cross-reference build process:
    • Binary file detection improved, increasing ignore list of file extensions.
    • PHP functions list updated with new PHP 5 enhancements.
    • Separate pages for PHP and project defined functions.
    • Summary page omitted if there are no includes or defines.
    • MySQL table for project configuration settings and statistics.


PHPCrossRef is maintained by Bert Garcia, please direct any comments, questions or suggestions to our inbox.