我是 HipHop 的新手,我正在尝试编译和运行自定义 PHP 应用程序,编译错误日志文件包含数百个与 $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"}
]
}
]
我在这里遗漏了一些明显的东西吗?
TIA