Wednesday, 15 August 2012

php - HipHop compiler doesn't recognise object $this variable -



php - HipHop compiler doesn't recognise object $this variable -

i new hiphop , i'm trying custom php application compile , run , compilation error log file contains hundreds of errors relating $this variable beingness "undeclared".. here simplified example:-

file bar.php:

class bar { private $_baz = 'hello'; public function __construct() { echo 'constructed'; } public function foo() { echo $this->_baz; } } $bah = new bar(); $bah->foo();

this file listed entry in list text file f.lst , hiphop compiler invoked...

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... files saved in /tmp/hphp_rc6ovl ... running hphp took 0'00" (357323 us) wall time

the resulting json error log /tmp/hphp_rc60vl/codeerror.js - contains this:-

[1,{"useundeclaredvariable":[{"c1":["bar.php",11,8,11,12] ,"d":"$this"} ] } ]

am missing obvious here?

tia

since posted question raised issue on github , informed have fixed bug caused issue -> https://github.com/facebook/hiphop-php/issues/698 - i've been diverted onto other things haven't had chance verify yet assume ok now.

php object compiler-errors this hiphop

No comments:

Post a Comment