HHVM 4.41
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.
Highlights
- A new type alias,
HH\enumname<TEnum>, represents the name of the enum typeTEnum(similarly toclassname<TClass>). - A new function,
HH\type_structure_for_alias, returns theTypeStructureof the specified type alias (similarly toHH\type_structurefor type constants in classes).- Note that the
TypeStructureAPI remains experimental and may be changed or removed in the future.
- Note that the
- Builtin functions
usort,uasort,uksortnow accept callbacks that return anynumvalue (intorfloat), allowing for more convenient sorting offloatarrays.- Note that these functions return
legacy arrays
which are deprecated. Prefer
Vec\sort,Dict\sort,Keyset\sort.
- Note that these functions return
legacy arrays
which are deprecated. Prefer
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 valuespcdata,anyandempty(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.
- XHP children declarations can now only contain defined, non-aliased,
non-generic Hack types, XHP category names (
- 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
returnsReferencewas removed fromReflectionFunctionandReflectionMethod. It always returnedfalsesince HHVM no longer supports references.