Because of various incompatibilities and installation difficulties HipHop for PHP is not the right solution for everyone deploying PHP.
In this article I present you the documentation about unimplemented functions in HipHop for PHP compiler. This is an enhanced copy of the github’s documentation which has been deleted from project’s website three days ago by unknown reason.
The article has been enhanced with my own notes to make it up-to-date and more friendly for the end-users.
General PHP features not supported:
- Runtime code evaluation using eval() or create_function()
Works in the hphpi interpreter, but not the hphp compiler
- Ordered use of function_exists() or class_exists() or get_declared_functions() or get_declared_classes()
in order to determine whether to include another file or not or see the affect of including another file – UNLESS the HDF AllVolatile option is enabled
- Dynamic function calls
Such as calling a function by name stored in a variable UNLESS the HDF AllDynamic option is enabled
- The preg_replace “/e” option
All the other options work fine
Some extensions that people commonly use are not supported, particular:
Support for SimpleXML is still incomplete. PHP scripts may become unstable when using this functionality.
Please note that HipHop for PHP has PDO (for MySQL) and an old MySQL extensions enabled
- Non-MySQL database APIs.
PostgreSQL, Microsoft SQL, Oracle and other.
Functions not implemented:
- some SPL functions: spl_autoload_register()
- some others
PHP config settings not implemented:
- many others (it may be that just memory_limit, max_execution_time, and arg_separator.output work)
Developers should look at the options available through Nginx, and the HDF file, for configuring the server instance. Most of PHP’s options are not very important, especially for a high performance production server, but those mentioned above are likely to be the biggest issues for people.
Other unsupported features
Other features not supported:
- Case insensitive constants (set via a special parameter to the define() function)
- Socket access to stdin/stdout
- Automatic rolling over of integers to floats if bounds are exceeded (on 64bit servers it’s much smaller issue than on 32-bit system, plus a performance issue)
- Compiled executables initialise global variables to NULL, so you won’t get an error if you reference an undefined variable
Other compatibility problems
Other compatibility problems may have been reported as issues: http://github.com/facebook/hiphop-php/issues
Things to remember
Generally you should avoid sloppy coding practices, such as:
- Coercing variables into arrays or objects by using inappropriate operators on them
- Generally it’s best to try and be type-strict in order to get maximum performance
An insightful presentation on the design of HipHop PHP is available below: