Arquivos
hhvm/hphp/test/quick/EmitOO.php
T
ptarjan 503f75d08b Rename test directories
These names don't make sense now that we run both suites the same
way.
2013-04-17 09:06:51 -07:00

78 linhas
1.3 KiB
PHP

<?php
print "Test begin\n";
interface I {
public function f($a);
}
class B {
}
class C extends B implements I {
const k = 42;
static $s = "s";
public $p0;
public $p1 = null;
public $p = 13;
protected $q = "q...";
private $r = array(1, 2, 3);
function __construct() {
print "In C::__construct()\n";
}
function f($a) {
# None-bare $this.
print "In C::f(), p : ".$this->p."\n";
print "In C::f(), q : ".$this->q."\n";
print "In C::f(), r : ".$this->r."\n";
$this->g(
# Bare $this.
$this);
$x = $this;
$this;
return $this;
# Ignored.
function f2() {
return $this;
}
}
function g($x) {
# None-bare $this.
print "In C::g(), p : ".$this->p."\n";
print "In C::g(), q : ".$this->q."\n";
print "In C::g(), r : ".$this->r."\n";
}
static function sf() {
print "In C::sf()\n";
}
}
function main() {
print "C::k : ".C::k."\n";
$X = "C";
print "$X::k : ".$X::k."\n";
# XXX Exit here to avoid unimplemented HHBC instructions.
exit(0);
C::sf();
# XXX Need SProp replacement.
#print "C::\$s : ".C::$s."\n";
#print "\$X::\$s : ".$X::$s."\n";
$c = new C();
print "\$c->p : ".$c->p."\n";
$c->f(43);
var_dump($c);
print "Test end\n";
}
main();