closure_045.phpt 313 B

12345678910111213141516171819
  1. --TEST--
  2. Closure 045: Closures created in static methods are static, even without the keyword
  3. --FILE--
  4. <?php
  5. class A {
  6. static function foo() {
  7. return function () {};
  8. }
  9. }
  10. $a = A::foo();
  11. $a->bindTo(new A);
  12. echo "Done.\n";
  13. --EXPECTF--
  14. Warning: Cannot bind an instance to a static closure in %s on line %d
  15. Done.