Arquivos
hhvm/hphp/test/vm/closure_static.php
T
ptarjan a6d70040fa fix static closures
I added the check for this in the interpreter but ##f_array_map## re-enteres the VM via a different path than FCall. Here is the equivilent check for the VM.
2013-03-21 16:51:06 -07:00

41 linhas
520 B
PHP

<?php
class A {
private $c = 1;
function b() {
$a = function () {
var_dump($this);
};
$a();
$a = static function () {
var_dump($this);
};
$a();
}
static function c() {
$a = function () {
var_dump($this);
};
$a();
$a = static function () {
var_dump($this);
};
$a();
}
static function d() {
var_dump(array_map(function($a) { return $a; }, array(1,2,3)));
}
}
(new A)->b();
A::b();
(new A)->c();
A::c();
(new A)->d();
A::d();