Historical PHP alternative / current Hack runtime12 min read

HHVM: a Hack virtual machine, not a PHP 8.4 runtime

HHVM is an open-source JIT virtual machine for the Hack language. This guide explains how it differs from PHP, why it is not a PHP 8.4 runtime, and where it fits.

PHP compatibility and project lifecycle

No PHP version compatibility is claimed by the supplied source. HHVM targets the Hack language and must not be treated as a PHP 8.4 or PHP 8.5 runtime. Versions, platforms, license and support policy are unknown from the supplied source.

Official sources checked 2026-10-22. Browser lessons on this site run PHP 8.5.

It relies only on the single official source supplied, the HHVM landing page. Anything that page does not state is marked unknown here rather than guessed.

What HHVM is

The HHVM site describes HHVM as an open-source virtual machine designed for executing programs written in Hack. It says HHVM uses just-in-time (JIT) compilation, and that the project moves fast, with daily changes and frequent releases. The page lists these features: the Hack language, JIT compilation, HNI, Proxygen and FastCGI support, and the hphpd debugger.

The page frames HHVM as a Hack runtime. It makes no claim of compatibility with any PHP version. This guide therefore does not describe HHVM as a PHP 8.4 runtime, and it does not describe it as a drop-in replacement for PHP.

Classification

The assigned classification is historical PHP alternative and current Hack runtime. Read it as two statements:

  • As an alternative way to run PHP applications, HHVM is historical. Do not choose it for new PHP production work, and do not expect it to run PHP 8.4 code.
  • As a runtime for Hack, the source describes it as actively developed. The page gives no dates or version numbers, so the current support status is unknown.

Because the evidence is incomplete, the lifecycle field for this entry is unknown.

HHVM is also not one of these other things:

  • It is not PHP core. PHP core is the reference language implementation that this course tracks, currently PHP 8.4, with PHP 8.5 planned.
  • It is not an async library, a framework adapter, or a CMS. Those run on top of PHP. HHVM is a separate virtual machine for a different language.

The same discipline applies elsewhere in this track. Drupal is a CMS product built on PHP, and it is not PHP itself. A framework component is not a CMS. Swoole and Open Swoole are distinct projects and need separate evidence. Check each project's own official sources instead of assuming that one name stands for another.

Architecture and execution model

The source gives a short description of the pipeline:

  1. Hack source code is compiled into an intermediate bytecode. HHVM does not interpret the source directly, and it does not compile it directly to C++.
  2. A JIT compiler translates that bytecode into x64 machine code dynamically at runtime.
  3. The page says this dynamic step allows optimizations that a statically compiled binary cannot make. It gives no benchmark numbers, and this guide makes no speed claims.

The page also mentions Proxygen and FastCGI support as serving options. It does not say how long a process lives, how state is shared between requests, or how workers are recycled, so those details are unknown from this source.

Request lifetimes and persistent workers

In the classic PHP model, each request starts with fresh state and discards it afterward. A persistent worker keeps the process alive across many requests, which changes what can go wrong:

  • Static properties, global variables, singletons, container instances and caches can carry one request's data into the next.
  • Open connections, file handles and per-user data such as an authenticated identity can leak the same way.

Cleanup practices for any long-lived worker include:

  • Keep request data in request-scoped objects.
  • Reset or avoid mutable statics.
  • Close or validate connections at request boundaries.
  • Recycle workers on a schedule.

The source does not document HHVM's exact request lifecycle. Confirm it in the official documentation before relying on any isolation assumption.

Practical use cases

The source supports a narrow set of uses:

  • Learning how a JIT-compiled virtual machine runs a typed language.
  • Running Hack programs on the runtime built for them.
  • Reading HHVM's history to understand why PHP engines and tooling evolved the way they did.

The source does not support these uses:

  • Running existing PHP 8.4 applications.
  • Running Composer-based PHP frameworks or CMS products.
  • Hosting WordPress, Drupal or similar systems.

For any framework or CMS, follow that product's own official setup. Do not assume it works on HHVM.

Installation approach

The landing page links to an Install page, a documentation site, a blog and a GitHub repository. It does not show commands, supported operating systems or package names in the captured text. So this guide gives no install commands and invents no image tags.

Use the official Install page for the supported method on your platform. Then confirm the result by asking the installed binary for its version, as the example below does. That example is only a minimal Hack program. It is not a PHP example and does not target PHP 8.4.

Strengths

Based on the source, HHVM offers these strengths:

  • It is an open-source runtime built specifically for Hack.
  • It uses JIT compilation, which the page ties to higher runtime performance.
  • It ships developer tooling such as the hphpd debugger.
  • It offers HNI and server-facing options, namely Proxygen and FastCGI support.

Limitations

  • No PHP 8.4 or PHP 8.5 compatibility is claimed. Treat it as incompatible with modern PHP unless official sources say otherwise.
  • Version numbers, license details, platform support and long-term support policy are unknown from the supplied source.
  • The page says changes arrive daily, so behavior may shift quickly.
  • The source does not describe the worker lifecycle, so state-isolation behavior is unverified.
  • Migrating a PHP codebase to Hack is a language change and not a configuration switch.

Deployment notes

The source names FastCGI as a supported mode. FastCGI is an internal protocol with no authentication. Never expose a FastCGI port publicly. Bind it to 127.0.0.1 or a private socket, and put a hardened web server in front if you ever use it. The example below does not start any network service.

Example scope

The example is a CLI-only Hack script. It needs a local HHVM installation, so it is not a browser exercise.

Where to go next

Read the HHVM site and follow its Install, Docs and Hack links. For production PHP work in this course, use PHP 8.4 with PHP-FPM or another documented PHP runtime instead.

Practical examples

These examples have not been run in a live environment yet. Commands and versions follow the official documentation linked on this page; check them before relying on them, and report a problem if one does not work.

Minimal Hack CLI program (not PHP 8.4)

A single Hack file with a typed entry point, run from the command line with a locally installed HHVM. It demonstrates that HHVM executes Hack and not PHP 8.4 code. Install HHVM first by following the official Install page. The commands assume the hhvm binary is on PATH.

src/main.hack

<?hh

<<__EntryPoint>>
function main(): void {
  $name = 'Hack';
  echo 'Hello from '.$name."\n";
}

Install and run

hhvm --version
hhvm src/main.hack

Expected behavior

The first command should print version information for the installed HHVM binary. The second command should print the line: Hello from Hack. If the hhvm binary is not found, install HHVM from the official Install page first.

Requires a local HHVM installation, so it is not a browser exercise. The commands are unverified and rest on the assumption that the hhvm binary is on PATH. This is Hack, not PHP, and it demonstrates no PHP 8.4 compatibility. No network service, FastCGI or Docker setup is included.