HHVM 2.4.0

Posted on February 1, 2014 by

It is that wonderful time again for an HHVM release. We’re sticking to our 8 week release cadence to keep everything fresh and in your hands. Also, remember you can run the nightly packages if you want a bleeding edge feature.



This release has many exciting points. First of all, 4 more large frameworks now pass 100% of their unit tests (using phpunit 3.9) – Laravel, Mockery, PHPUnit and CodeIgniter. Remember to put HHVM in your travis config and we just might do a drive-by and make them all pass.

Big fixes:

  • A full rewrite of the ini parser
  • Support for the same recursive __get() and __set() semantics as php-src
  • Implemented try {} finally {}
  • Various reflection bugs
  • Turned on the Region JIT,  which makes the blocks of code that we translate larger giving more opportunity for speedups


You might notice our new naming scheme for our 2 week releases. Since we are the HipHop team, we thought it would be fitting to use hiphop themed names. If you have suggestions for release names feel free to comment. Also, we noticed that there are 52 weeks in the year and with a release every 2 weeks, we can name them alphabetically and just perfectly fit. So far we’ve had Appleseed, Beastie Boys and Coolio.

Security Fixes:

CVE-2014-1439Fix libxml_disable_entity_loader(). This was also part of the 2.3.3 release.

Full Changelog:

  • Turn on Region JIT
  • FastCGI fixes, perf improvements
  • ext_zend_compat fixes
  • Turn on XLS Register Allocator by default
  • Fix server stats reporting
  • num‘ scalar typehint that accepts both ints and floats
  • fix support for typedef’d namespaces
  • don’t swallow fatals when autoloading
  • Map collections learned the in-place retain() and retainWithKey()
  • rename Set::difference() to Set::removeAll()
  • Update Set to retain element insertion order
  • remove APC stats
  • Fixes for ARM mode
  • FrozenMap collection
  • Deprecated Vector|Set|Map::put() method removed
  • == between Frozen{Vector|Set|Map} and {Vector|Set|Map} now can return true
  • Support lex-time binary constants (eg. 0b10111)
  • StreamWrappers now support rmdir, mkdir, rename and unlink
  • Miscellaneous Zend PHP compatibility fixes
  • Default StatCache to off
  • Miscellaneous FastCGI fixes
  • Miscellaneous region compiler fixes
  • Map and StableMap collections use the same underlying implementation
  • Trait requirements enforced
  • hhprof performance improvements
  • Add array to string conversion notice
  • Add RaiseNotice IR opcode
  • Fix VirtualHost.<name>.Pattern matching
  • Fix various memory leaks (pdo_parse_params, Gen*WaitHandle)
  • Import a lot more Zend tests that used to crash or hang
  • Clean up base.h
  • XLS register allocation cleanup
  • Enable region compiler by default for JIT functions in ahot
  • Fatal on eval() in RepoAuthoritative mode
  • Enable Link Time Optimization (LTO) for HHVM
  • Fix a few SPL compatibility issues
  • Fix issues with DOCUMENT_ROOT in fastcgi
  • Better type inference for collections and builtins in repo mode
  • Shorter syntax for lambda expressions w/ automatic captures
  • Parser support for trait require clauses
  • Move FrozenVector and Set to the HH namespace
  • Fix resource to array conversion
  • Fix a request local memory leak in foreach of apc arrays
  • Initial php_odbc API implementation
  • Implement PHP’s hash_copy() function
  • Experimental tool: Memoization Opportunity Profiler
  • Various small parity/behavior fixes (in phar, proc_open, filter_var)
  • A Eval.DumpHhas=1 option to dump hhas for a php file
  • Better warnings in Set::toArray
  • Fix the behavior of foreach loops in finally blocks
  • chmod -x runtime/vm/jit/*.{cpp,h}
  • Changes to make hhvm build clean with clang-3.4
  • Fix array_product to not be bug-compatible with PHP 5.2
  • Change the Map datastructure—preserves order and does faster foreach
  • FrozenSet collection
  • Generate pid.map when we unmap text section, for the perf tool
  • Implemented GlobIterator
  • Implemented Reflection::export and Reflection::getModifierNames
  • support date.timezone in ini files
  • implement fileinfo
  • special comparisons for DateTime
  • delete unimplemented functions
  • support for the finally clause in try blocks

Posted in Announcement | Leave a reply

28 Responses to “HHVM 2.4.0”

  1. Great news!
    Do you have a live document that shows framework compatibility? If not, it would be great to have a link somewhere here, showing how each framework is doing during each release.

  2. SoboLAN says:

    I just installed it today and was wondering why I got the 2.4 version as, from what I knew, the latest version is 2.3. It’s nice when things work out :) .

    Awesome job, guys, as always.

  3. Luis Morales says:

    Coincidentally I installed a fresh hhvm today around 6:00 ET, just in time to get the new version. So, technically I got hhvm 2.4 before the rest of the world knew about it. Booyah!

  4. Markus says:

    Any benchmark of this new release?

  5. Makara Sok says:

    Nice! Doing my tests as we speak :).

    Next release: Dr. Dre?

  6. Dave Hulbert says:

    “Shorter syntax for lambda expressions w/ automatic captures” sounds interesting. Are there any docs on it?

  7. wwbmmm says:

    Good job!
    In which release will mysqli be available?

      • Christopher Svanefalk says:

        Does this mean we might be seeing compatibility between Moodle and HHVM as of 2.5.0? From what I have heard there is at least some interest within the Moodle community for reaching HHVM compliance, with the lack of mysqli being the chief show stopper.

        We have deployed Moodle for one of our educational clients. It is a beast of a PHP app (both in terms of size and runtime complexity), and it would be interesting to see how well it runs under HHVM.

  8. Pierre says:

    Works great!!
    Since 2.4 our Piwik Solution works like a charm.
    The combination of Nginx + FastCGI + HHVM 2.4 is overwhelming.

    From 2.4s per request down to 142ms with hhvm <3

  9. Serj says:

    Do you plan to support Ruby and Python syntax enough to run Rails and Django ?

  10. Congrats! Recursive __get() fix is a great plus… Theneeds.com is joining the party…

  11. Rocco Zanni says:

    Any plans for having an officially supported PDO postgresql extension?

  12. brian says:

    One of the most critical aspects of a deployment is diagnostics. Are you guys going to put hooks in your code so companies like New Relic can hook in

  13. Javier says:

    I recently installed nginx and hhvm-fastcgi and after a few tries I maked work properly my yii framework app, but is too slow compared with LAMP, maybe I missing something, plz help me.

    • Shivaas says:

      Is your Ngingx configured properly? I would suggest taking a look at optimizing the Nginx config, as well as seeing if your hosting infrastructure is limiting performance.

  14. Rob says:

    I’ve been using hhvm for my site for over 6 months and have never looked back. The best stack has to be nginx with spdy enabled, fastcgi and hhvm. I rarely see CPU usage rise over 2% even during busy periods. You guys who are working on hhvm have created a true work of art. The only thing that I feel is missing is support for Unix sockets over fastcgi… Do you guys plan on implementing this any time soon?

  15. sanghee says:

    hhvm on centOS 6.5 What is the latest package?

Leave a Reply