php-src/Zend/tests/closure_045.phpt
Nikita Popov bc2ff4a299 Don't implicitly make closures in static methods static
It makes no sense that you can't write a closure using $this in a
static method, even though you can write one outside a class.

Now only closures that have been marked as static will be considered
to be static.

Fixes bug #65598.
2015-05-06 17:29:05 +02:00

19 lines
247 B
PHP

--TEST--
Closure 045: Closures created in static methods are not implicitly static
--FILE--
<?php
class A {
static function foo() {
return function () {};
}
}
$a = A::foo();
$a->bindTo(new A);
echo "Done.\n";
--EXPECTF--
Done.