4d7004e955
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.
19 linhas
263 B
PHP
19 linhas
263 B
PHP
<?php
|
|
class A {
|
|
public function b() {
|
|
return function() {
|
|
return function() {
|
|
return $this->c();
|
|
};
|
|
};
|
|
}
|
|
private function c() {
|
|
return 91;
|
|
}
|
|
}
|
|
$a = new A;
|
|
$b = $a->b();
|
|
$first = $b();
|
|
$second = $first();
|
|
var_dump($second);
|