bug81626.phpt 430 B

1234567891011121314151617
  1. --TEST--
  2. Bug #81626: Error on use static:: in __сallStatic() wrapped to Closure::fromCallable()
  3. --FILE--
  4. <?php
  5. class TestClass {
  6. public static bool $wasCalled = false;
  7. public static function __callStatic(string $name, array $args): string
  8. {
  9. static::$wasCalled = true;
  10. return 'ok';
  11. }
  12. }
  13. $closure = Closure::fromCallable([TestClass::class, 'foo']);
  14. var_dump($closure());
  15. ?>
  16. --EXPECT--
  17. string(2) "ok"