HHVM 4.8.0
HHVM 4.8 is released! This release has long term support, so:
- this release will be supported for approximately 48 weeks
- the next LTS will be released in approximately 24 weeks
- HHVM 3.30 and HHVM 4.3-4.7 remain supported
- HHVM 3.27 and HHVM 4.2 are no longer supported
Highlights
- XHP attributes can now be marked
@lateinit, to indicate that an attribute is required, but may be set via->setAttribute(). This is currently equivalent to@required, however if thecheck_xhp_attributeoption is set in.hhconfig, an error is raised if a@requiredattribute is ommitted at instantiation; for example,class :a { attribute string b @required; } <a />will raise a typechecker error because ofbnot being specified, howeverclass :c { attribute string d @lateinit; } <c />will raise a runtime error if->setAttribute('d', 'someValue')is not called before render, but will not raise a typechecker error. This new behavior will not be optional in a future release. - The
.hhconfigoptionsdisable_unsafe_expranddisable_unsafe_blockare now supported, removing support for// UNSAFEand/* UNSAFE_EXPR */; we recommend usinghhast-migrate --add-fixmesthen usingsedor similar to remove theUNSAFEandUNSAFE_EXPRcomments. This behavior will not be optional in a future release. - HSL v4.7.0
adds a
Ref<T>class, to wrap values in objects.
Breaking Changes
- The typechecker will now raise errors if it can identify that an expression
being used in a boolean context is falsey, but not actually the boolean value
false; for example,$x = null; if ($x) { /* ... */ }. - The
and,or, andxoroperators have been removed from the runtime; they previously raised typechecker errors. Use$a && $b,$a || $b, or(bool) $a !== (bool) $binstead. - By-reference properties are now a parse error.
- Fix some unsoundness issues when using
isorinstanceofwith generics; this may lead to the typechecker raising errors in more places.