有以下值得关注的更新:
optional shape fields 现在与 nullable shape fields 不同。
支持 VSCode 语言服务器协议,这将很快被 Nuclide 的 Hack 整合使用
函数可能不再命名为 using(),因为这将与即将到来的 using 特性相冲突
支持使类型检查器完全忽略某些文件;这是通过 ignored_paths .hhconfig 实现的,其中包含一个正则表达式数组 - 例如,ignored_paths = [ "vendor/.*tests?/"
现在支持元组常量
方法调用现在支持括号表达式
修复了一些需要中断(Ctrl-C) hh_client的情况
支持针对 OpenSSL 1.1 进行构建,例如 Debian Stretch,Ubuntu Zesty 和 Ubuntu Artful
Hack 的实验性 bytecode emitter 替代方案
即将到来的变更:
Call-Time Pass-By-Reference
HHVM 3.24 将要求引用参数在调用点处标记 - 例如:[code]function foo(array
sort(&$bar);
}[/code]3.23 中的 Hack 允许使用这种语法,但不需要这种要求。可以通过在 .hhconfig 中将 safe_pass_by_ref 添加到 enable_experimental_tc_features 来选择加入这种要求。
Lambda 类型推断
在 HHVM 3.24 中,将使用预期的 lambda 类型来改进它们;例如,下面的代码没有错误:[code]class MyClass {}
class MyClosureRunner<-T> {
public function __construct(private (function(T): string) $closure) {}
}
function expectsMyClosureRunnerMyClass(
MyClosureRunner
): MyClosureRunner
return $x;
}
function getThing1(): MyClosureRunner
$var = expectsMyClosureRunnerMyClass(
new MyClosureRunner(
function(/* MyClass */ $arg) {
$arg->missing_method();
return "ok";
},
),
);
return $var;
}[/code]在 3.24 中,或者在 .hhconfig 中使用 enable_experimental_tc_features=contextual_inference,typechecker 会引发以下错误:[code]test.php:19:15,28: Could not find method missing_method in an object of type MyClass (Typing[4053])
test.php:10:19,25: This is why I think it is an object of type MyClass
test.php:3:7,13: Declaration of MyClass is here[/code]目前,3.23 的最新修正版 3.23.2 也已发布。
软件详情:https://hhvm.com/blog/2017/11/17/hhvm-3-23.html
下载地址:http://git.oschina.net/mirrors/hhvm
来自:开源中国社区

