Arquivos
hhvm/hphp/test/vm/closure_recursive_bad.php
T
ptarjan 4d7004e955 :Allow $this on closures
In Zend 5.3 they decided that closures should inherit the ##$this## from the containing scope. This brings us close to paraity with them. The remaining thing is to make

    function() use ($this) {}

fatal after we purge it from WWW.
2013-03-21 16:50:12 -07:00

18 linhas
236 B
PHP

<?php
class A {
public function b() {
function c() {
return function() {
return $this->d();
};
};
return c();
}
private function d() {
return 91;
}
}
$a = new A;
$b = $a->b();
var_dump($b());