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

34 linhas
345 B
PHP

<?php
trait T {
function f() {
return function ($a) {
if ($a) {
return $this->foo;
}
};
}
}
class X {
private $foo = 1;
use T;
}
class Y {
private $foo = 2;
use T;
}
function test() {
$x = new X;
$c = $x->f();
var_dump($c(true));
$y = new Y;
$c = $y->f();
var_dump($c("foo"));
}
test();