php-src/Zend/tests/bug69568.phpt
Nikita Popov d9c2959c27 Fix LSB handling for closures
Closures will now use the called_scope from their instantiation
site. If they are rebound either the class of $this is used or if
no $this is provided the bound scope is used.

With this change the scope for static closures can be changed back
to use EG(scope) rather than EX(called_scope), thus fixing
bug #69568.
2015-05-05 21:14:03 +02:00

26 lines
350 B
PHP

--TEST--
Bug #69568: call a private function in closure failed
--FILE--
<?php
class A {
private static function testprivate() {
return 1;
}
public static function test() {
return function() {
return self::testprivate();
};
}
}
class B extends A {
}
$fn = B::test();
echo $fn();
?>
--EXPECT--
1