A virtual machine designed for executing programs written in Hack and PHP.
C++ PHP Hack OCaml C CMake Other
Latest commit 537f8d8 Dec 2, 2016 @andrewjkennedy andrewjkennedy committed with Hhvm Bot Remove invert_grow_super and fix meth_caller
During subtyping, we allow "unresolved" types to grow on the right of the subtype relation. That is, if we are solving
t <: a:=Tunresolved[t1,...,tn]
(where `a` is a type variable bound to a list of types in `Tunresolved`) then we let the list grow, so

Now, if we are solving
C<t1> <: C<t2>
for a contravariant class `C`, then this reduces to
t2 <: t1
At present, we 'track" this flipping of the relation so that instead of growing unresolved types on
the right (in the supertype) we grow them on the left (in the subtype). This is broken (see additional test below).
There are other problems with subtyping (in particular, `a:=Tunresolved[] <: t` is ignored) and it's possible
that this diff will surface these, but let's fix the problems one at a time.

This fix also uncovered a problem with `meth_caller`. Now that function types are contravariant in parameters, we don't need to play the trick with `as` on an extra generic parameter that was used in the implementation of `meth_caller`. This fixes the problems with `meth_caller`: it is now sound.

Reviewed By: jamesjwu

Differential Revision: D4226678

fbshipit-source-id: 91e8f7fa8ec97cc04c08d1faec18bf3fe4dfb32c



HHVM page | HHVM documentation | Hacklang page | General group | Dev group | Twitter

HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP. HHVM uses a just-in-time (JIT) compilation approach to achieve superior performance while maintaining the development flexibility that PHP provides.

HHVM supports Hack, PHP 5 and the major features of PHP 7. We are aware of minor incompatibilities, so please open issues when you find them. HHVM also supports many extensions as well.

HHVM should be used together with a webserver like the built in, easy to deploy Proxygen, or a FastCGI-based webserver on top of nginx or Apache.


If you're new, try our getting started guide.

You can install a prebuilt package or compile from source.


You can run standalone programs just by passing them to hhvm: hhvm my_script.php.

If you want to host a website:

  • Install your favorite webserver. Proxygen is built in to HHVM, fast and easy to deploy.
  • Install our package
  • Start your webserver
  • Run sudo /etc/init.d/hhvm start
  • Visit your site at http://.../index.php

Our getting started guide provides a slightly more detailed introduction as well as links to more information.


We'd love to have your help in making HHVM better. If you're interested, please read our guide to contributing.


HHVM is licensed under the PHP and Zend licenses except as otherwise noted.

The Hack typechecker (hphp/hack) is licensed under the BSD license (hphp/hack/LICENSE) with an additional grant of patent rights (hphp/hack/PATENTS) except as otherwise noted.

Reporting Crashes

See Reporting Crashes for helpful tips on how to report crashes in an actionable manner.

Reporting and Fixing Security Issues

Please do not open GitHub issues or pull requests - this makes the problem immediately visible to everyone, including malicious actors. Security issues in HHVM can be safely reported via HHVM's Whitehat Bug Bounty program:


Facebook's security team will triage your report and determine whether or not is it eligible for a bounty under our program.


Our user FAQ has answers to many common questions about HHVM, from general questions to questions geared towards those that want to use.

There is also a FAQ for contributors to HHVM.