HHVM 4.5.0
HHVM 4.5 is released! This release will be supported for 6 weeks, and HHVM 4.1+ remain supported.
This weeks’s release is focused on performance improvements and increased consistency between typechecker and runtime errors.
Highlights
- Adds
Shapes::at()
, which is similar toShapes::idx()
, but throws if the field is not set. This is useful for optional fields.
Breaking Changes
- Dynamic method invocations (
$foo->$bar()
) and property access ($foo->$bar
) now raise a typechecker error unless$foo
isdynamic
. - A typechecker error is now raised for contravariant or covariance in method and function type parameters. This was previously a runtime error.
- It is now a runtime error to invoke static methods as if they were instance
methods (e.g.
$foo->someStaticMethod()
). This was previously a typechecker error. - Deprecation notices are now raised at runtime for invoking instance methods statically. This was previously a typechecker error.
Other Notes
- Raise a clearer error when the type of a Hack array literal contains typos
- Improved compatibility with hhbbc and GCC 9.1
Future Changes
- we plan to remove support for
UNSAFE
,UNSAFE_BLOCK
, andUNSAFE_EXPR
comments in a future release, in favor of more explicitHH_FIXME[code]
comments and future language features. The behavior ofUNSAFE
comments can be disabled with thedisable_unsafe_expr
anddisable_unsafe_block
options in.hhconfig
New features in HSL-Experimental
HSL-Experimental 4.5.0 adds advanced async helper classes, including
Async\Poll
and Async\Semaphore
among others. We strongly recommend
avoiding Async\Poll
when alternatives exist.
For details, see the release notes.