我是新手,我正在尝试编译和运行一个自定义的HipHop应用程序,编译错误日志文件包含数百个与$this变量“未声明”相关的错误。下面是一个简化的例子:
文件bar.php:
class Bar {
     private $_baz = 'Hello';
     public function __construct() {
         echo 'Constructed';
     }
     public function foo() {
         echo $this->_baz;
     }
}
$bah = new Bar();
$bah->foo();该文件作为列表文本文件f.lst中的唯一条目列出,并调用HipHop编译器...
root@hiphop:/home/rich/www# hhvm --hphp --input-list=f.lst -k 1 --log=3
running hphp...
creating temporary directory /tmp/hphp_rC6OVL ...
parsing inputs...
parsing inputs took 0'00" (3605 us) wall time
pre-optimizing...
pre-optimizing took 0'00" (1757 us) wall time
analyze includes...
analyze includes took 0'00" (4 us) wall time
inferring types...
inferring types took 0'00" (1503 us) wall time
post-optimizing...
post-optimizing took 0'00" (2870 us) wall time
creating binary HHBC files...
creating binary HHBC files took 0'00" (254854 us) wall time
saving code errors...
all files saved in /tmp/hphp_rC6OVL ...
running hphp took 0'00" (357323 us) wall time生成的JSON错误日志/tmp/hphp_rC60VL/CodeError.js -包含以下内容:
[1,{"UseUndeclaredVariable":[{"c1":["bar.php",11,8,11,12]
 ,"d":"$this"}
]
}
]我是不是漏掉了什么明显的东西?
提亚
发布于 2013-05-19 19:39:26
自从我发布了我的问题后,我在GitHub上提出了一个问题,我被告知他们已经修复了导致问题-> https://github.com/facebook/hiphop-php/issues/698的错误-我已经被转移到其他事情上,所以我还没有机会验证这一点,但我现在假设它是OK的。
发布于 2013-05-16 07:36:10
这是在HHVM上的吗?对我来说,在HHVM上试用您的示例效果非常好。
https://stackoverflow.com/questions/14980985
复制相似问题