phc logo

Contributing to phc

What to contribute

We have added most of the work that needs to be done to the Bug tracker. In particular, if you have any of the following skills, or are willing to learn them, we could do with your help (if you dont know what to do, but want to help, ask us on the phc-general list, we're friendly):

  • 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.

How to contribute

Still interested? Announce yourself on the mailing list, and tell us what you're interested in working on. If you have no preference, we can point you in the right direction.

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.

Getting started:

The documentation 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.

Contributors

Paul Biggar is the current maintainer of phc.

phc was started by Edsko de Vries and John Gilbert. Paul Biggar joined the project around version 0.1.5, and became maintainer sometime after version 0.1.7.

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