Facebook Engineering Blog
HHVM – Implementing MySQLi

HHVM – Implementing MySQLi

3/3/2014 · Emil Hesslow

What this post added

This post details the implementation of the MySQLi extension for HHVM. It covers the preparation phase, including rewriting the ini parser and leveraging HNI and docskel.php for extension development. The implementation involved passing through calls to older MySQL equivalents and using PHP to implement the procedural interface. Significant effort was put into testing, including updating the Zend import script to handle parallel test execution and modifying tests related to ZendParamMode. Roadblocks included implementing `mysqli_stmt::bind_param()` and `mysqli_stmt::bind_result()`, which required extensions to HNI for variable arguments and pass-by-reference. The implementation of `mysqli_multi_query()` and related functions was simplified by leveraging existing HHVM implementations. The post outlines the current test pass rate, real-world compatibility with Doctrine DBAL and CodeIgniter, and identifies missing pieces such as php.ini interaction, error message differences, MySQL Native Driver support, and behavioral differences. Future work includes supporting ZendParamMode for PHP functions in HNI and passing more failing Zend tests, with a planned release in HHVM 2.5.0.

Read the original post ↗