HHVM 2.2.0
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
Comments
- Nick: Can you define what "many many more" means? Do all of the frameworks from the previous post now work?
- John: CentOS too please!
- James: 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/
- KroKite: When will it start supporting ` mysqli `. I am curious. Does `2.2.0` supports centos 6+ too.. :) 17% CPU usage reduction is kool :)
- Jan Safranek: Hello, please port it for FreeBSD! :) Thank You
- Andy Grunwald: 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!
- Paul Tarjan: Awesome, thank you. Can you update the wiki to point to yours?
- euskadi31: Can you add Gentoo ?
- David: Thanks. Could you also package for openSUSE, please?
- Lucas Costa: Thaaaaaaaaaaank yoooooou!
- Brian: Another vote for Centos!
- Mickey Mouse: 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.
- Jabbon: Centos 6.x plz!!!!!!
- Paul Tarjan: There are instructions here that looked pretty complicated: https://github.com/facebook/hhvm/wiki/Building-and-Installing-on-FreeBSD-8.2 Can you take a look and see if they are up to date and fix them if they are not, then I can package it next time.
- Paul Tarjan: Yes, mysqli is on the near-term roadmap. A few months is my guess. I would love a pull request for it if you need it faster :) As for CentOS 6 I tried to follow these instructions https://github.com/facebook/hhvm/wiki/Building-and-installing-HHVM-on-CentOS-6.4 and libmemcached wouldn't even compile so I didn't continue. Can you update the instructions and I can package it next time then?
- Paul Tarjan: I'm not an active FreeBSD user but if you want to update the package, please do and edit the wiki accordingly.
- Paul Tarjan: A member of the community just added https://github.com/javer/gentoo-overlay/tree/master/dev-php/hhvm . I'm not sure if it works, but please try it out and fix anything that is broken.
- Paul Tarjan: I tried but I'm not very familiar with that distro. Can you make a wiki page on how to compile it on openSUSE? Then I'll add a package next release.
- Drew Paroski: Click on the link (http://www.hhvm.com/blog/875/wow-hhvm-is-fast-too-bad-it-doesnt-run-my-code) for more details on which frameworks work on HHVM at present.
- dandecoded: Yessss!!! Thank you HHVM!
- Naresh: centos 6.x version is available at http://nareshv.blogspot.in/2013/10/install-hhvm-220-final-release-on.html
- Tomsilav: 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
- Rob: I noticed you added support for redis sessions. Is there anyway I can use memcache as a session handler?
- Aleksey: Windows? -- OpenSUSE nice too :)
- Paul Tarjan: can you update https://github.com/facebook/hhvm/wiki/HHVM-Pre-built-packages-for-Centos-6.4 please?
- Paul Tarjan: Not right now, but if you sent us a pull request, we would happily take it.
- Paul Tarjan: 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.
- David: There already is a wiki about compiling on openSUSE. http://en.opensuse.org/SDB:Compiling_software
- Adrian Luca: Tested HHVM on TurnkeyLinux 13 (Debian 7) / Virtualbox 1GB RAM and it works very nice.
hhvm -m server -c /etc/hhvm/config.hdf </code> (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 :) .
- Gabriel: Is ZF2 now supported? I see the wiki</a> says that the intl package is now available for hhvm.
- slashrsm: 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.
- Paul Tarjan: Yup. Enjoy.
- Joshua Katz: 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?
- Louie: 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 Route::get('users',function(){ return "Point to controller when its done!!"; }); Anyone who can shed some light?
- Lucas Costa: 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: 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.
- qianzhihe: 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. thanks.
- Thomas: Hey, can anyone point me to the key used for signing the Ubuntu-packages? Thanks in advance!
- Webprogramming.ws » Blog Archive » HHVM 2.2.0 « HipHop Virtual Machine: […] http://www.hhvm.com/blog/1301/hhvm-2-2-0 […]
- wwbmmm: When will Zend compatibility layer be available? It is very useful for us.
- Alex: 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 !
- Paul Tarjan: 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.
- Paul Tarjan: 1) We match php.net's implementation 2) Yes
- Alex: 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.
- iry: centos is not supported by the packager for that distro!!!
- Mihail: Also need Centos 6.
- carlos: happened with mysqli, for when will be?
- Aniruddh Singh: Is there an oci8 (Oracle) extension for hhvm?
- Rohit: Can you please provide HHVM for fedora 14 ?
- Dima: Vote for CentOS 6.5!
- patlecat: I need Hack/HHVM for openSUSE with the Yii-Framework! And Windows would be nice for development.
- Jinank: I need Hack/HHVM for openSUSE 13.1 too.
- HHVM 2.2.0 mit neuen Paketquellen für wichtige Linux-Distributionen - entwickler.de: […] in Version 2.2.0, sowie das Changelog, in dem alle Veränderungen aufgelistet werden findet Ihr in der offiziellen Anküngigung. Zum Download geht es unter folgendem Link. Für die Pre Built Packages müsst Ihr eine Paketquelle […]