HHVM 4.26.0
HHVM 4.26 is released! This release marks the end of support for 4.20; 4.21–4.25 remain supported, as do the LTS releases 3.30 and 4.8.
Highlights
- various IDE integration improvements (better autocompletion, more contextual information on hover)
- values with
dynamic
type can now be used in more places (inside XHP,unset
statements) - it is no longer a Hack error to declare a method with the same name as its encompassing class (previously error 3007, which was added to prevent confusion due to the fact that these methods would act as constructors in HHVM versions prior to 4.0)
- closing an SQLite connection when there are unfinalized prepared statements will now schedule the connection to be closed later, instead of returning an error
- an experimental new syntax was added for union types
(Cat | Dog)
and intersection types(FourLegged & Mammal)
– this is an early experimental prototype not meant for general use (it is entirely possible that the prototype will never make it to a final release, depending on, for example, how it affects typechecking performance in various scenarios), but if you want to experiment with it, addunion_intersection_type_hints=true
to your.hhconfig
Breaking Changes
- most built-in types (e.g.
int
,vec
,Vector
,Traversable
,Awaitable
) are now case-sensitive at runtime (previously only the typechecker treated them as case-sensitive) - magic methods (e.g.
__get
,__call
) can no longer have inout parameters - all remaining
&$reference
parameters in built-in functions were migrated to inout parameters or removed – from those, the following ones are not backwards compatible:- previously optional argument is now required:
flock
(usehhast-migrate --ref-to-inout
for automated migration)SplFileObject::flock
- previously optional argument was completely removed:
NumberFormatter::parse
(useparseWithPosition
when the optional argument is needed)IntlDateFormatter::parse
(useparseWithPosition
)Memcached::get
(usegetWithCasToken
)Memcached::getByKey
(usegetByKeyWithCasToken
)Memcached::getMulti
(usegetMultiWithCasTokens
)Memcached::getMultiByKey
(usegetMultiByKeyWithCasTokens
)
- the following functions were completely removed because they used reference
parameters in undesirable ways:
current_ref
(usecurrent
which returns the same value, but takes a non-reference argument)key_ref
(usekey
)xml_set_object_ref
(usexml_set_object
)PDOStatement::bindParam
(usebindValue
instead)PDOStatement::bindColumn
(usebindValue
)SQLite3Stmt::bindparam
(usebindvalue
)
- previously optional argument is now required:
Future Changes
With all &$references
in built-in functions gone, we expect that references
will be completely removed from the Hack language within the next few releases.
See detailed blog post.