Main Page

From HipHop for PHP

Jump to: navigation, search

Contents

What is HipHop for PHP

HipHop for PHP is a source code transformer for PHP script code. It programmatically transforms your PHP source code into highly optimized C++ and then uses g++ to compile it. HipHop executes the source code in a semantically equivalent manner and sacrifices some rarely used features — such as eval() — in exchange for improved performance. HipHop includes a code transformer, a reimplementation of PHP's runtime system, and a rewrite of many common PHP Extensions to take advantage of these performance optimizations.

HipHop was created by Facebook to save resources on their servers. It is being distributed with its over 300.000 lines of source code written in C++ and C as free software under the terms of version 3.01 of the PHP License.

Why HipHop

One of the explicit design goals leading into HipHop was the ability to continue writing complex logic directly within PHP. Companies with large PHP codebases will generally rewrite their complex functionality directly as PHP extensions in either C or C++. Doing so ends up reducing the number of people who are able to work on the company’s entire codebase. By keeping this logic in PHP, Facebook is able to move fast and maintain a high number of engineers who are able to work across the entire codebase.

Using HipHop for PHP

HipHop for PHP is an open source project, you can get the all of this on GitHub under the open source PHP license.

Checkout and build instructions:

git clone git://github.com/facebook/hiphop-php.git

HipHop currently supports PHP version 5.2 and will be updated to support 5.3.

HipHop has been developed on CentOS and Fedora, building on other operating systems may not currently be functional. Support will be added as soon as its ready. At the moment, HipHop can only run on 64 bits systems.

External links

  • Facebook - HipHop for PHP: Move Fast
  • GitHub - Facebook's HipHop at master
Personal tools