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::getCoeffectsandReflectionMethod::getCoeffects). - Improved
hackfmtformatting of function calls that haveis/asexpressions 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::isFinalwill returnfalseif theReflectionClassrepresents 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_callerwith a method that has anyinoutparameters. 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 tostringandintvalues in the future. These two types were chosen because they’re the only types with an unambiguousstringrepresentation (compared to e.g. aboolvalue which could be represented as “0”, “false”, or currently “”; similarly fornull; andfloatvalues can have arbitrary precision as well as special cases likeNaN).- The
.hhconfigoptionenable_strict_string_concat_interp=truecan be used to enable the future behavior now. - For more details, see related discussion.
- The