发布于 2017-11-21 01:02:51 | 165 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

HHVM 执行PHP代码的虚拟机

HipHop VM(HHVM)是Facebook推出的用来执行PHP代码的虚拟机,它是一个PHP的JIT(Just-In- Time)编译器,同时具有产生快速代码和即时编译的优点。


HHVM 3.23 已发布,此版本包含新功能、错误修复、性能改进和支持未来改进的工作。

有以下值得关注的更新:

  • optional shape fields 现在与 nullable shape fields 不同,有关帮助迁移的详细信息和工具,请参阅 3.22 发布公告

  • 支持 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 将要求引用参数在调用点处标记 - 例如:

function foo(array<string> $bar): void {    sort(&$bar);  }

3.23 中的 Hack 允许使用这种语法,但不需要这种要求。可以通过在 .hhconfig 中将 safe_pass_by_ref 添加到 enable_experimental_tc_features 来选择加入这种要求。

Lambda 类型推断

在 HHVM 3.24 中,将使用预期的 lambda 类型来改进它们;例如,下面的代码没有错误:

<?hh // strict  class MyClass {}  class MyClosureRunner<-T> {    public function __construct(private (function(T): string) $closure) {}  }  function expectsMyClosureRunnerMyClass(    MyClosureRunner<MyClass> $x,  ): MyClosureRunner<MyClass> {    return $x;  }  function getThing1(): MyClosureRunner<MyClass> {    $var = expectsMyClosureRunnerMyClass(      new MyClosureRunner(        function(/* MyClass */ $arg) {          $arg->missing_method();          return "ok";        },      ),    );    return $var;  }

在 3.24 中,或者在 .hhconfig 中使用 enable_experimental_tc_features=contextual_inference,typechecker 会引发以下错误:

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

更新内容较多,详情请查看发布主页

目前,3.23 的最新修正版 3.23.2 也已发布。



历史版本 :
PHP 虚拟机 HHVM 3.24 正式发布:不再支持 PHP 5
PHP 虚拟机 HHVM 发布 3.23.4, 3.21.5 和 3.18.7 版本
HHVM 3.23.3 发布,高速的 PHP 执行引擎
HHVM 3.23 发布,高速的 PHP 执行引擎
HHVM 3.19.0 发布,执行 PHP 代码的虚拟机
HHVM 3.17.1 发布,执行 PHP 代码的虚拟机
HHVM 3.17.0 发布,执行 PHP 代码的虚拟机
HHVM-3.12.10 和 HHVM-3.15.2 发布
HHVM 3.15.0 发布,执行 PHP 代码的虚拟机
HHVM 3.9.9 、3.12.8 和 3.14.5 发布
HHVM 3.12.7 和 3.9.8 发布
HHVM 3.14.3 发布,执行 PHP 代码的虚拟机
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务