blob: 6409ceb4ab6720218d51341f0f1480b655ad1df2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
--TEST--
Bug #66811: Cannot access static::class in lambda, writen outside of a class
--FILE--
<?php
class A {
public static function f() {
return function () {
var_dump(self::class);
var_dump(static::class);
};
}
}
class B extends A {}
$f = B::f();
$f();
$g = $f->bindTo(null, A::class);
$g();
$foo = function () {
var_dump(self::class);
var_dump(static::class);
};
$bar = $foo->bindTo(null, A::class);
$bar();
?>
--EXPECT--
string(1) "A"
string(1) "B"
string(1) "A"
string(1) "A"
string(1) "A"
string(1) "A"
|