phc logo

New release

After two years without releases, phc version 0.2.0 is available for download. There are many new features (check out the ChangeLog) principally that ability to compile PHP code into executables. We are actively looking for contributors - see how you can help.

What is phc?

phc is an open source compiler for PHP with support for plugins. In addition, it can be used to pretty-print or obfuscate PHP code, as a framework for developing applications that process PHP scripts, or to convert PHP into XML and back, enabling processing of PHP scripts using XML tools.

phc for PHP programmers (See Manual):

  • Compile PHP source into an (optimized) executable.
  • Compile a web application into an (optimized) extension.
  • Pretty-print PHP code.
  • Obfuscate PHP code (--obfuscate flag - experimental).
  • Combine many php scripts into a single file (--include flag - experimental).
  • Optimize PHP code using classical compiler optimizations (in the dataflow branch - very experimental).

phc for tools developers (See Developers and Contributors):

  • Analyse, modify or refactor PHP scripts using C++ plugins.
  • Convert PHP into a well-defined XML format, process it with your own tools, and convert it back to PHP.
  • Operate on ASTs, simplified ASTs, or 3-address code.
  • Analyse or optimize PHP code using an SSA-based IR (in the dataflow branch - very experimental).

News (archive)

10 December 2008. phc version 0.2.0 has been released! This is the first release to support compiling PHP code, and supports nearly all features (except OO). Read the ChangeLog for more details.

21 October 2008. The first beta release of phc version 0.2.0 has been made available. Changes since the alpha include fixing garbage collection in the compiler, and bringing the documentation up-to-date. Read the announcement for more details.

12 October 2008. As part of a push for greater contributions to phc, the php-internals mailing list has been opened up for general membership.

21 September 2008. phpcompiler.org has been given an overhaul. Although most of the changes are behind the scenes, we've added a contribution page, to make it easier for potential contributors to contribute to phc.

See the news archive for older news.

Recent project activity:

There were 56 commits in the last 7 days. Most recent:

r2229 | paul.biggar | 2009-01-06 19:12:54 +0000 (Tue, 06 Jan 2009) | 2 lines

Make nightlies save compare benchmarks, and create .pngs of those results.

r2228 | paul.biggar | 2009-01-06 16:59:46 +0000 (Tue, 06 Jan 2009) | 2 lines

Add CANNOT_BE_REF annotation, for variables not in the alias set. Put them in nearly all places that can use them.

r2227 | paul.biggar | 2009-01-06 13:46:32 +0000 (Tue, 06 Jan 2009) | 2 lines

Merge valbench_compare into trunk.