bug47857.phpt 563 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Bug #47851 (is_callable throws fatal error)
  3. --FILE--
  4. <?php
  5. class foo {
  6. function bar() {
  7. echo "ok\n";
  8. }
  9. }
  10. var_dump(is_callable(array('foo','bar')));
  11. try {
  12. foo::bar();
  13. } catch (Error $e) {
  14. echo $e->getMessage(), "\n";
  15. }
  16. var_dump(is_callable(array('Exception','getMessage')));
  17. try {
  18. Exception::getMessage();
  19. } catch (Error $e) {
  20. echo $e->getMessage(), "\n";
  21. }
  22. ?>
  23. --EXPECT--
  24. bool(false)
  25. Non-static method foo::bar() cannot be called statically
  26. bool(false)
  27. Non-static method Exception::getMessage() cannot be called statically