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 theTypeStructure
of the specified type alias (similarly toHH\type_structure
for type constants in classes).- Note that the
TypeStructure
API remains experimental and may be changed or removed in the future.
- Note that the
- Builtin functions
usort
,uasort
,uksort
now accept callbacks that return anynum
value (int
orfloat
), allowing for more convenient sorting offloat
arrays.- 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
,any
andempty
(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_FIXME
s 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 fromReflectionFunction
andReflectionMethod
. It always returnedfalse
since HHVM no longer supports references.