开发者

Why can't I compile PHP code? [duplicate]

开发者 https://www.devze.com 2023-04-05 18:52 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Can you “compile” PHP code?
This question already has answers here: Closed 11 years ago.

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 give开发者_Python百科n platform. Why can't I create a binary file that would be the same code that PHP would run when given my .php file?


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消