Skip navigation.

PHP compilers

The number of implementations of PHP continue to rise and rise. Among those I can list are:

  • Recently, Caucho wrote a PHP5 to Java bytecode compiler and built it into their Resin server. There's not much information, but in the link, look for thread responses by Scott Ferguson, the compiler author.
  • The experimental Pint, a PHP to parrot compiler.
  • The commercial Roadsend PHP to binary compiler.
  • The .NET framework Phalanger, a PHP to MSIL compiler (added 22 Dec 2005).
  • The original mod_php from php.net.
  • The PHP4Mono compiler for Mono (added 27 Feb 2006).

I am excited about all these implementations. Most computationally intensive compiler benchmarks have shown a 5-10 times speedup over mod_php. Perhaps it is only a matter of time before we see a JIT compiler for PHP to Intel opcodes, built into mod_php...

A more curious question is why there has been so little takeup of these faster technologies. Some speculation here:

  • PHP is fast enough? The bottleneck is the database or the network, and not PHP?
  • PHP 4->5->6 is changing too fast to trust someone else?
  • No formal PHP specification or conformance suite makes switching more risky?
  • Not all PHP extensions or libraries are available on other platform?
  • Lack of knowledge or awareness? Or are we still in early adopter stage?