Arquivos
hhvm/hphp/test/vm/prop_ctx.php
T
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08: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();