HHVM 2.2.0

Posted on October 17, 2013 by

We released a new version of HHVM today. A big change is that we are now packaging for many of the popular distros.

If your favorite one isn’t there, leave a comment and we’ll try to add it. Or if you want to become the packager for that distro, great! Bundle it up and then update the wiki.

The new packages have their files moved around a bit. Everything is now named hhvm in there, so if your scripts relied on anything named hiphop-php please update them.

This release was a 17% CPU reduction for running facebook.com compared to HHVM 2.1.0. It also supports many more frameworks out of the box like Symfony, CodeIgniter, Laravel, and many more.

Some big changes you might notice are

  • Reading .phar files works
  • Redis support
  • php.ini support
  • Many new SPL classes were added and fixed
  • ArrayObject and ArrayIterator had some bugs fixed
  • Many fixes to shutdown handlers and autoload handlers
  • Jemalloc is now the default memory allocator

Here is the full HHVM 2.2.0 Changelog for your enjoyment:

  • Fixed issue that caused memory_get_usage to report double the actual usage.
  • Direct invocation of callable arrays: $f = [$cls_or_instance, 'method']; $f()
  • ASAN clean
  • Support dynamically loadable extensions
  • Support loading mini-systemlibs from extensions
  • Fix issues with __toString() functions that return non-string values
  • Smarter memory allocation and scheduling for NUMA systems
  • Improve profiler performance in the jit
  • Fix several Zend compatibility issues
  • Fix several bugs uncovered by ASAN
  • Add collection support to array_keys, array_values, and array_combine
  • Return a set-like array from Set::toArray
  • Add to(Vector|Map|StableMap|Set) methods to collections
  • Collections convert to boolean false when empty
  • get_class_vars invokes the autoloader when necessary
  • Rework the Zend compatibility layer to be more robust
  • Allow traits to implement interfaces
  • Support arbitrary expressions inside empty()
  • HNI (HipHop Native Interface) for calling C++ functions from Php
  • Fix PropertyAccessorMap::isset
  • Expose more POSIX constants
  • Fixed behavior of stream_get_contents when default args are used.
  • Implement str_getcsv, and fix some fgetcsv related issues.
  • [IPv6] Fix stream_socket_recvfrom & stream_socket_sendto.
  • [IPv6] Fix socket_sentto_recvfrom_ipv6_udp Zend compatibility.
  • Optimize closure invocation and __invoke (~3x faster to invoke)
  • string and object allocation optimizations (reduced memory usage for both)
  • Fix order of custom attributes and visibility in ctor arg promotion
  • Implement CachingIterator
  • Implement RecursiveCachingIterator
  • Generalized heuristic for choosing when to inline in the jit
  • Introduced a Zend compatibility layer to compile extensions
  • Use gcc-4.8.1 by default
  • Improve hhvm commandline parsing logic
  • Fix register_shutdown in session_set_save_handler to match PHP 5.4
  • Add “native” functions for use in Systemlib
  • PHP extension source-compatitblility layer
  • Fix ArrayIterator constructor PHP compatibility
  • Enable building against libmemcached 1.0.8
  • Debugger: $_ not cleared but still printed after exception
  • Fix clone of SplPriorityQueue
  • Debugger: Fix bugs when multiple threads hit the same breakpoint
  • Fix several namespace bugs
  • Several PHP compatibility fixes for ArrayObject and ArrayIterator
  • Fix list assignment with collection literals
  • HHVM should compile with libmemcached 1.0.9+
  • Support “(new Vector {..})->method()” style syntax
  • use trigger_error in PHP for Redis user errors
  • multiple simplexml fixes
  • fixed serialize/unserialize for SplObjectStorage
  • Implement ReflectionParameter::IsCallable()
  • Async stack traces in the debugger via the “wa” command
  • Fix late static binding in static closures
  • Fix breakpoints on generators
  • Add SplObserver and SplSubject interfaces
  • Update Iterable interface and add toArray() method
  • Allow __get for undefined properties
  • Implement get_included_files()
  • Limit use of huge pages
  • Implement stream_is_local
  • Implement read support for .phar
  • Implement assert with string arguments
  • Implement RecursiveArrayIterator
  • Implement php_strip_whitespace()
  • Support for timeouts in cli mode
  • Closure allocation optimizations (~2x faster to allocate a closure)
  • Implement Redis session handler
  • New memory profiler, hhprof, with pprof compatible output
  • Update isset($string[$k]) and empty($string[$k) to PHP 5.5 semantics
  • Fixed a few parser bugs
  • Fixed a few bugs with token_get_all()
  • Fix (string)$obj semantics when __toString() is not defined
  • Optimize vector-shaped Arrays (arrays with keys in range 0..size-1)
  • Enable HHBC by default in debug builds
  • Implement SplObjectStorage::getInfo()
  • Initial rough draft of xhpast2, a replacement for xhpast
  • fix compilation on Ubuntu 13.04
  • OSX changes, next round
  • Modify PHP’s ext/standard/math/tests/(pow|abs).phpt to be HHVM friendly
  • add XHP comment syntax based on http://www.w3.org/TR/REC-xml/#sec-comments

Posted in Announcement | Leave a reply

52 Responses to “HHVM 2.2.0”

  1. Nick says:

    Can you define what “many many more” means? Do all of the frameworks from the previous post now work?

  2. John says:

    CentOS too please!

  3. James says:

    Since the previous Arch package on the AUR was out-of-date, I’ve made a new one that should work perfectly here: https://aur.archlinux.org/packages/hhvm/

  4. KroKite says:

    When will it start supporting ` mysqli `. I am curious.
    Does `2.2.0` supports centos 6+ too.. :)

    17% CPU usage reduction is kool :)

  5. Jan Safranek says:

    Hello, please port it for FreeBSD! :) Thank You

  6. Hey,

    thanks for this! Is FreeBSD support planned for 2.2.0 ?
    In the github wiki there is a page for this: https://github.com/facebook/hhvm/wiki/Building-and-installing-HHVM-on-FreeBSD-from-ports
    But sadly only the 2.1.0 port is available.

    Thx for feedback!

  7. euskadi31 says:

    Can you add Gentoo ?

  8. David says:

    Thanks. Could you also package for openSUSE, please?

  9. Lucas Costa says:

    Thaaaaaaaaaaank yoooooou!

  10. Brian says:

    Another vote for Centos!

  11. Mickey Mouse says:

    Thanks for your hard work, guys!

    I don’t know about the plans, but I see a real possibility of this replacing the PHPimplementation we have today, if you call it that since there’s no spec.

    I would most definitely move all my productions sites to the HHVM if that happened. Only thing I would like to have is better integrated testing tools or I don’t know, its just too boring to test on PHP today, compared to ruby and python.

  12. Jabbon says:

    Centos 6.x plz!!!!!!

  13. dandecoded says:

    Yessss!!! Thank you HHVM!

  14. Tomsilav says:

    Good job and another vote for CentOS.

    We are planning to start testing and adjusting our internal PHP framework to run under HHVM, so another tester is joining soon :)

    Btw, does HHVM have (or is it planned) support for async HTTP/Websockets – allowing us to implement handlers for “realtime web apps”?

    again, good job

    • Paul Tarjan says:

      Thanks. Let us know any bugs you run into.

      For async, is there a PHP equivalent? Cursory googling just shows some frameworks that probably work already. Please try them and report back.

  15. Rob says:

    I noticed you added support for redis sessions. Is there anyway I can use memcache as a session handler?

  16. Aleksey says:


    OpenSUSE nice too :)

  17. Adrian Luca says:

    Tested HHVM on TurnkeyLinux 13 (Debian 7) / Virtualbox 1GB RAM and it works very nice.

    hhvm -m server -c /etc/hhvm/config.hdf
    (I had to specify the config file manually because it doesn’t read the default in etc)

    It should be mentioned somewhere that it actually needs 1.2GB of RAM for the server to startup.(I used a swap file)

    The scope was testing drupal 7, drupal 8 alpha4 so:

    - D7 installed smooth but:
    — cannot create / upload files
    — no php-gd (i think) and cannot acces the admin page to switch to imagemagick.
    — no clean urls for now

    - D8 installed in minimal mode, with errors and cannot acces the admin or frontpage.

    Thank you for your effort and sharing :) .

  18. Gabriel says:

    Is ZF2 now supported? I see the wiki says that the intl package is now available for hhvm.

  19. slashrsm says:

    Are custom stream wrappers already supported in HHVM? I remember that they were not ~8 months ago but couldn’t find out if they are now.

  20. Joshua Katz says:

    Now that this update is recommended I will now give this a test. Does anyone know how to run HHVM as a service so I can easily manage my web server?

  21. Louie says:

    I tried Laravel 4, I got to the application itself but somehow, routes doesn’t work… I don’t know why.. and also I had to manually enter index.php instead of the hhvm pointing it to index.php by default…

    I tried
    return “Point to controller when its done!!”;

    Anyone who can shed some light?

  22. Lucas Costa says:

    Paul (or anyone else) help me! I’m trying to run gettext on HHVM, like stated in the changelog, but I’m getting “Undefined function” for gettext() an _().

    Thanks in advance!

    • Lucas Costa says:

      Sean Cannella on GitHub:
      That is a mistake in the changelog. gettext is being run via the experimental Zend compatibility layer that can run PHP extensions built for Zend as-is which is still, as the name suggests, experimental.

      Paul Tarjan on GitHub:
      Sorry, this is still being worked on and isn’t available for use. Changelog updated.

      • wwbmmm says:

        When will Zend compatibility layer be available? It is very useful for us.

        • Paul Tarjan says:

          As soon as I’m confident it works. My metric is “take an existing extension, try to compile it, see how much has to change”. If the amount of unimplemented functions is too high, I have to keep iterating.

          Right now, I’m trying to see if I can get our headers to have C linkage so you don’t even have to do the C -> C++ conversion.

          If you want to try it out now, feel free to compile your code against the headers I have there and see what doens’t link.

  23. qianzhihe says:

    hi, could you please share this wordpress theme?
    we just wanna to build a chinese hhvm documents site, and help the people who is not good at english can learn hhvm easily.


  24. Thomas says:


    can anyone point me to the key used for signing the Ubuntu-packages?
    Thanks in advance!

  25. Alex says:

    I have 2 questions:

    1.Does HHVM produce a value for boolean false.On true PHP returns 1 but on false doesn’t show nothing.
    2.Does HHVM works with PDO ?

    Thank you !

  26. Alex says:

    But in hack( strict type checker mode) what it returns for false value?
    It is a pain on large scripts PHP does not show something for boolean false.

  27. iry says:

    centos is not supported by the packager for that distro!!!

  28. Mihail says:

    Also need Centos 6.

  29. carlos says:

    happened with mysqli, for when will be?

  30. Aniruddh Singh says:

    Is there an oci8 (Oracle) extension for hhvm?

  31. Rohit says:

    Can you please provide HHVM for fedora 14 ?

  32. Dima says:

    Vote for CentOS 6.5!

  33. patlecat says:

    I need Hack/HHVM for openSUSE with the Yii-Framework! And Windows would be nice for development.

  34. Jinank says:

    I need Hack/HHVM for openSUSE 13.1 too.

Leave a Reply