我是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編譯器調用...
[email protected]:/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