Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HipHop compiler doesn't recognise object $this variable #698

Closed
rich06 opened this issue Feb 22, 2013 · 2 comments
Closed

HipHop compiler doesn't recognise object $this variable #698

rich06 opened this issue Feb 22, 2013 · 2 comments

Comments

@rich06
Copy link

rich06 commented Feb 22, 2013

I am new to HipHop and I'm trying to get a custom PHP application to compile and run and the compilation error log file contains hundreds of errors relating to the $this variable being "Undeclared".. here is a 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 is listed as the only entry in a list text file f.lst and the HipHop compiler is 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...
all 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 I missing something obvious here?

TIA

@ghost
Copy link

ghost commented Feb 23, 2013

Same issue here.

@paroski
Copy link

paroski commented Mar 22, 2013

This has been fixed by 63f228d .

@paroski paroski closed this as completed Mar 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants