HHVM 4.41 is released! This release marks the end of support for 4.34; HHVM 4.35–4.40 remain supported, as do the 4.8 and 4.32 LTS releases.


  • A new type alias, HH\enumname<TEnum>, represents the name of the enum type TEnum (similarly to classname<TClass>).
  • A new function, HH\type_structure_for_alias, returns the TypeStructure of the specified type alias (similarly to HH\type_structure for type constants in classes).
    • Note that the TypeStructure API remains experimental and may be changed or removed in the future.
  • Builtin functions usort, uasort, uksort now accept callbacks that return any num value (int or float), allowing for more convenient sorting of float arrays.

Breaking Changes

  • Fixed a bug that allowed XHP children declarations to contain undefined types. This may reveal many previously ignored errors.
    • XHP children declarations can now only contain defined, non-aliased, non-generic Hack types, XHP category names (%foo), and the special values pcdata, any and empty (case-sensitive).
    • Note that only the children declaration is type-checked, not the actual children where the XHP element is used. A library such as xhp-lib must be used for that.
  • Typechecker errors due to assigning a value of the wrong type to an inout parameter are now reported at the location where the inout parameter is declared. This may require some HH_FIXMEs to be moved.
  • Typechecker errors due to incorrect use of the argument unpacking operator (...$args) were updated to provide more information in different cases. In some cases this results in changed error numbers, but it shouldn’t result in any new errors.
  • The method returnsReference was removed from ReflectionFunction and ReflectionMethod. It always returned false since HHVM no longer supports references.