hhvm 中 http_get 的等价物是什么?

What is the equivalent of http_get in hhvm?

我想你可以使用 file_get_contents,但是在 hhvm 中是否有等同于 http_get 的东西?当我使用 google 时,它指向 hhvm 文档,它只是说它不受支持。

在 HHVM 中标记为缺失的此类函数通常是因为该函数是尚未实现的扩展的一部分。 PHP.net docs say it's part of a PECL extension, pecl_http -- which doesn't look to be on by default even in PHP5 (although of course it can be manually enabled). So definitely looks like the relevant extension hasn't been implemented in HHVM. If this function specifically is really important, and you can't find an adequate replacement, you can file a feature request issue on GitHub 让团队知道您希望实施它。 (当然,如果您想自己实现,也可以发送拉取请求!)

至于替换,我会从 file_get_contents 开始;如果这不能满足您的需求,我很确定 the curl extension exists in HHVM。它具有大量的功能,但您几乎可以肯定地使用它来做任何您需要的事情。