mirror of
https://github.com/php/php-src.git
synced 2024-10-03 15:56:11 +00:00
20 lines
313 B
Plaintext
20 lines
313 B
Plaintext
|
--TEST--
|
||
|
Closure 045: Closures created in static methods are static, even without the keyword
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
class A {
|
||
|
static function foo() {
|
||
|
return function () {};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
$a = A::foo();
|
||
|
$a->bindTo(new A);
|
||
|
|
||
|
echo "Done.\n";
|
||
|
|
||
|
--EXPECTF--
|
||
|
Warning: Cannot bind an instance to a static closure in %s on line %d
|
||
|
Done.
|