phc logo

Contributing to phc

Getting Involved

The simplest way of getting involved is to pick a simple task to do. There are two ways of doing this:

  • Running the test suite, and seeing what fails. (This is probably the best way).
  • Picking a task marked Trivial or Easy in the Bug tracker.
Feel free to ask questions on the mailing list.

Getting started:

The documentation page lists a few talks and papers that give overviews of the whole compiler, the front-end and the back-end.

The manual describes how most phc passes, which are either visitors or transforms, work. Other passes are typically once-off, and the code is the documentation. If there is any code where the intent and function of the code is not clear from the code or documentation, please bring it to our attention, and we will explain it.

What to contribute

The following list describes what you can do with your particular skills:

  • C / Zend API:

    If you're familiar with the Zend API, the most important work we need completed is code generation. We currently don't support PHP's OO features in our compiled code, and this is probably our highest priority.

    After building phc, run make test. Programs which need code generation support can be examined in test/logs/latest/Generate_C.

  • C++:

    The compiler is written in C++, and most changes require some C++. Fortunately, most of the C++ we use is simple, and the only exceptions (templates) are relatively rare. A good way to find things to do is to grep the current sources for TODO comments. See also the previous section.

  • C:

    Some important parts of the compiler are written in C, such as the parser and lexer. We have a number of parser/unparser bugs, which mostly need to be solved in the parser. Knowledge of flex/bison is useful for solving these.

    If you know C, perhaps you'd like to look at code generation. Even if you arent familiar with the Zend API, you can learn it by:

  • PHP:

    Our test framework needs a lot of love. The most important fix is to support the PHPT tests from PHP.

    We have a test bot (see test/framework/records), that checks out each version from our repository, builds it, tests it, and records the results. Issue 61 details a number of changes we'd like to more fully test each revision.

  • Haskell:

    Most of phc is run on code generated by our other project, maketea. Bugs labeled as Maketea should be fixed within maketea (though we use phc's mailing list for this).

  • Autotools/Makefiles:

    The issues list a number of bugs in our autotools files. If you have experience with autoconf, automake, libtool and make, it should not be difficult to fix these.

  • Packagers:

    We'd like phc to be available through package managers, rather than requiring people to download and compile the source.

  • Webmaster:

    If you're interested in being our webmaster, please get in touch.

Bug reports:

Please report bugs directly to the phc-general list. We can update the issue tracker from there. The list archives may provide hints to you, but you should feel free to contact us.

After seeing real bugs, we generally fix them on the spot. Bugs which we cannot fix immediately, we add to our bug database.

If you have a program which shows the bug, that would be incredibly helpful. If you are able to fix the bug, please send us patches. We will verify them and apply them (and add your name to the contributors list). If your program is too long to send as a bug report, our test suite includes the reduce script. This automatically reduces your program by removing statements from it, but keeps the bug intact. It has in the past been useful for reducing test cases, and may be useful for you.

Mailing lists:

phc-general is for questions where most users of the phc may be interested in the response. phc-internals is for questions where only the developers and contributors would be interested. It also receives an email for each bug update and svn commit. If you are unsure of the proper place to send your email, don't worry about it, and try the phc-general list. There will be a friendly response there.

Authors and Contributors

phc was started in 2005 by Edsko de Vries and John Gilbert. Paul Biggar joined after version 0.1.7 and currently maintains phc, as well as spending an awful lot of time on the experimental dataflow branch; Edsko works on code generation and is currently adding support for object oriented features.

In addition, the following list (alphabetically by first name) of people have contributed to phc: Alexey Zakhlestin, Andras Biczo, Andreas Korthaus, Atanas Beloborodov, Conor McDermottroe, Daniel Barreiro, Daniel Fabian, Dan Libby, David Abrahamson, Eric Bouwers, Jakub Suchy, Johan B.W. de Vries, Lorenzo Bettini, Marc Eisenbarth, Matthias Kleine, Mike Dupont, Ryan Stutsman, Sven Klemm, Tim Van Holder.