2

Possible Duplicate:
Can you “compile” PHP code?

After I write an application in PHP, why can't I compile it into machine language? I know that it's possible to make a byte-code version of the file, which (as I understand it) is basically a file that has already been parsed into tokens.

But that's not what I want. Clearly it can't work in a general sense, since compiled code will be platform-specific, but let's say I have chosen a given platform. Why can't I create a binary file that would be the same code that PHP would run when given my .php file?

Community
  • 1
  • 1
Robert Martin
  • 16,759
  • 15
  • 61
  • 87

2 Answers2

7

You can, facebook released a project which is currently being updated for php 5.3 (supports everything lower iirc) called HipHop, you can find it here: https://github.com/facebook/hiphop-php

1

There are a few compilers out there like facebook's, mentioned by @Howard, or http://www.roadsend.com/home/index.php?pageID=compiler. I've never tried them though.

Robert Martin
  • 16,759
  • 15
  • 61
  • 87
David Laberge
  • 15,435
  • 14
  • 53
  • 83