bug77877.phpt 464 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Bug #77877 call_user_func() passes $this to static methods
  3. --FILE--
  4. <?php
  5. class Foo {
  6. static public function bar() {
  7. var_dump($this);
  8. }
  9. }
  10. try {
  11. array_map([new Foo, 'bar'],[1]);
  12. } catch (Throwable $e) {
  13. echo $e->getMessage() . "\n";
  14. }
  15. try {
  16. call_user_func([new Foo, 'bar']);
  17. } catch (Throwable $e) {
  18. echo $e->getMessage() . "\n";
  19. }
  20. ?>
  21. --EXPECT--
  22. Using $this when not in object context
  23. Using $this when not in object context