| HipHop for PHP | |
|---|---|
| Developer | Facebook, Inc. |
| Initial release | February 2, 2010; 16 years ago (2010-02-02)[1] |
| Final release | |
| Written in | C++,Hack,OCaml,Rust |
| Successor | HHVM |
| License | PHP License |
| Website | github |
| Repository | |
HipHop for PHP (HPHPc) is a discontinuedPHPtranspiler created byFacebook. By using HPHPc as asource-to-source compiler, PHP code is translated intoC++, compiled into abinary and run as anexecutable, as opposed to the PHP's usual execution path of PHP code being transformed intoopcodes andinterpreted. HPHPc consists mainly of C++,C and PHP source codes, and it isfree and open-source software distributed under thePHP License.
The original motivation behind HipHop was to save resources on Facebook servers, given the large PHP codebase of facebook.com. As the development of HipHop progressed, it was realised that HipHop could substantially increase the speed of PHP applications in general. Increases in web page generation throughput by factors of up to six have been observed over theZend PHP.[4][5][6][7][8] A stated goal of HPHPc was to provide a high level of compatibility for Zend PHP, where most Zend-based PHP programs run unmodified on HPHPc.[6] HPHPc was originallyopen sourced in early 2010.[1]
As an addition to HPHPc, Facebook engineers also created a "developer mode" of HipHop (interpreted version of a PHP execution engine, known asHPHPi) and the HipHopdebugger (known asHPHPd). These additions allow developers to run PHP code through the same logic provided by HPHPc while making it possible to interactively debug PHP code by definingwatches,breakpoints, etc. Running the code through HPHPi yields lower performance when compared to HPHPc, but the developer benefits were, at the time, worth having to maintain these two execution engines for production and development. HPHPi and HPHPd were also open sourced in 2010.[1]
By many accounts HPHPc fulfilled its goals, especially within Facebook as it allowed facebook.com to run much faster while using fewer resources. However, in early 2013 Facebook deprecated HPHPc in favor of theHipHop Virtual Machine (HHVM), which is ajust-in-time (JIT) compilation-based execution engine for PHP, also developed by Facebook.[2][9] There were many reasons for this; one of them was HPHPc's flattened curve for further performance improvements. Also, HPHPc did not fully support the PHP language, including thecreate_function() andeval() constructs, and it involved a specific time- and resource-consuming deployment process that required a bigger than 1 GB binary to be compiled and distributed to many servers in short order. In addition, maintaining HPHPc and HPHPi in parallel (as they needed to be, for the consistency of production and development environments) was becoming cumbersome. Finally, HPHPc was not a drop-in replacement for Zend, requiring external customers to change their whole development and deployment processes to use HPHPc.[2]