Arquivos
hhvm/hphp/test/quick/prop_ctx.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

35 linhas
451 B
PHP

<?php
trait t {
public static function f($o) {
var_dump($o->prop);
}
public static function set($o, $v) {
$o->prop = $v;
var_dump($o);
}
}
class a {
use t;
private $prop = 'I am private in a';
}
class b extends a {
public $prop = 'I am public in b';
}
function main() {
$b = new b();
$b->f($b);
t::f($b);
$b->set($b, 'new value');
t::set($b, 'newer value');
$a = new a();
$a->f($a);
t::f($a);
}
main();