HHVM 4.75
HHVM 4.75 is released! This release marks the end of support for 4.68; HHVM 4.69–4.74 remain supported, as do the 4.32 and 4.56 LTS releases.
Highlights
- Continued improvements to the recently added highlighted error formatter.
- The environment variable
FORCE_ERROR_COLORcan be used to forcehh_clientto output color escape sequences even if the output is not a terminal, e.g. to save the output into a file that can be printed to a compatible terminal later.
Breaking Changes
is_array()is now equivalent toHH\is_any_array()(previously equivalent toHH\is_php_array()). We expect this to be the last step beforeis_array()is removed completely (it had already been removed from the typechecker since HHVM 4.71, but for now is still available at runtime), so please migrate toHH\is_any_array()(preserving the new behavior),HH\is_php_array()(preserving the old behavior), or another of the alternatives listed in HHVM 4.71 release notes.- The built-in functions
call_user_func()andcall_user_func_array()were deprecated. Using them raises a typechecker error, but for now still works at runtime (we expect runtime support to also be removed soon).- Use
$callable()instead, where$callableis an anonymous function, or the return value fromfun(),class_meth(),inst_meth()ormeth_caller(). All of these are understood by the typechecker, so the change may reveal previously hidden errors. - Using a
stringas$callableraises a typechecker error, but for now still works at runtime. However, we expect it to stop working soon, as the native “function pointer” types returned by the functions above will become the only valid representations of functions and methods.
- Use
- The INI option
hhvm.emit_func_pointershas been removed,fun()now always returns a native “function pointer” type instead of astring.hhvm.emit_cls_meth_pointersand other related flags are also expected to be removed soon.
- The type of exception thrown when using a
stringkey (instead ofint) to index into avarraychanged fromOutOfBoundsExceptiontoInvalidArgumentException.- In previous HHVM versions, the
hhvm.hack_arr_compat_noticesINI option can be used to raise a notice (in addition to theOutOfBoundsException) in these cases.
- In previous HHVM versions, the
- Changed behavior of the
>and>=operators onvarrays to be consistent withvecs. This only affects rare cases such as comparing arrays of objects orNANvalues.- Both before and after this change, comparing any array types using these operators raises a typechecker error and often has surprising and inconsistent results at runtime, so it should be avoided.
Future Changes
is_array()will be removed completely.- Support for using
strings or tuples to represent functions and methods will be removed in a future release. They are being replaced by a native “function pointer” type.- Using
fun()or another option listed above guarantees that the return value will be compatible with the specific HHVM version being used, no matter which type it uses to represent functions.
- Using