1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
--TEST-- Closure 056: self::class in non-static closure in static method. --FILE-- <?php class A { static function foo() { $f = function() { return self::class; }; return $f(); } } class B extends A {} var_dump(B::foo()); --EXPECT-- string(1) "A"