HHVM 4.49
HHVM 4.49 is released! This release marks the end of support for 4.43; HHVM 4.44–4.48 remain supported, as do the 4.8 and 4.32 LTS releases.
Highlights
- New
.hhconfigoptiondisable_modes(previouslydisable_partial) will cause the typechecker to treat all files as strict (comments after<?hhno longer have special meaning).- The default value will be
falsefor the foreseeable future.
- The default value will be
- New
hackfmtflag--format-generated-codecan be used to format generated and partially generated files. - Fixed a bug that could cause part of
hackfmtoutput to be missing when formatting partially generated files, and other minor fixes and improvements forhackfmt. - Fixed a bug that could prevent the “go to type” IDE feature from working inside async functions.
- Improved various typechecker error messages, e.g. when accessing an optional
shape field it now recommends using
Shapes::idxinstead of??.
Breaking Changes
- Comparing (
<,>,<=,>=,<=>) a legacy PHP array with a non-array now throwsInvalidOperationException(previously only raised a Notice). It had already been a typechecker error. - It is now a runtime error if
class_methis used with arguments that are not a::classand a string literal (a string literal as the 1st argument will also not cause a runtime error, but::classliteral is recommended). It had already been a typechecker error.- If a dynamic pointer is required, annotate the method with
<<__DynamicallyCallable>>and useHH\dynamic_class_meth().
- If a dynamic pointer is required, annotate the method with
Future Changes
- We are working towards deprecating (and eventually removing from the language)
“magic methods”
such as
__callor__get. Currently, you can use the INI optionhhvm.no_use_magic_methods=trueto trigger warnings whenever a magic method is invoked, e.g. when an undefined method is called on a class that has the__callmagic method. - Comparing Hack arrays to
true,false, andnullwith the “fuzzy” equality operators (==,!=) will be changed so that non-empty Hack arrays are== trueand empty Hack arrays are== falseand== null.- The INI option
hhvm.hack_arr_empty_based_bool_eq_cmp=truecan be used to enable this behavior now. - The new behavior is consistent with legacy arrays, making it easier to migrate to Hack arrays.
- The INI option