HHVM 4.97
HHVM 4.97 is released! This release marks the end of support for 4.91; HHVM 4.92–4.96 remain supported, as do the 4.56 and 4.80 LTS releases.
Highlights
- Traits can now have constants.
- Contexts
of a function/method can now be accessed via reflection
(
ReflectionFunction::getCoeffects
andReflectionMethod::getCoeffects
). - Improved
hackfmt
formatting of function calls that haveis
/as
expressions as arguments.
Breaking Changes
<<__Rx>>
and related built-in attributes (__RxShallow
,__RxLocal
) were removed. Use contexts and capabilities instead.- Enums are no longer considered final
(
ReflectionClass::isFinal
will returnfalse
if theReflectionClass
represents an enum). This is due to upcoming features, enum classes and enum inclusion.- The built-in attribute
<<__Sealed>>
can be used to add restrictions to specific enums.
- The built-in attribute
- It is now a typechecker error to use
meth_caller
with a method that has anyinout
parameters. It had already been a runtime error, but previously wouldn’t be caught by the typechecker. - The typechecker now checks XHP constructor calls (bad calls would previously result in a runtime error, but wouldn’t be caught by the typechecker). This may reveal new errors, but it should be rare, since XHP class declarations rarely override the built-in default constructor, and are usually instantiated using the standard XHP syntax instead of explicit constructor calls.
Future Changes
- We expect string concatenation (
'hello '.$name
) and interpolation ("hello $name"
) to become restricted tostring
andint
values in the future. These two types were chosen because they’re the only types with an unambiguousstring
representation (compared to e.g. abool
value which could be represented as “0”, “false”, or currently “”; similarly fornull
; andfloat
values can have arbitrary precision as well as special cases likeNaN
).- The
.hhconfig
optionenable_strict_string_concat_interp=true
can be used to enable the future behavior now. - For more details, see related discussion.
- The