You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
722 B

  1. --TEST--
  2. ReflectionMethod constructor errors
  3. --CREDITS--
  4. Robin Fernandes <robinf@php.net>
  5. Steve Seear <stevseea@php.net>
  6. --FILE--
  7. <?php
  8. class TestClass
  9. {
  10. public function foo() {
  11. }
  12. }
  13. try {
  14. echo "Too few arguments:\n";
  15. $methodInfo = new ReflectionMethod();
  16. } catch (Exception $e) {
  17. print $e->__toString();
  18. }
  19. try {
  20. echo "\nToo many arguments:\n";
  21. $methodInfo = new ReflectionMethod("TestClass", "foo", true);
  22. } catch (Exception $e) {
  23. print $e->__toString();
  24. }
  25. ?>
  26. --EXPECTF--
  27. Too few arguments:
  28. Warning: ReflectionMethod::__construct() expects exactly 1 parameter, 0 given in %s on line 12
  29. Too many arguments:
  30. Warning: ReflectionMethod::__construct() expects exactly 1 parameter, 3 given in %s on line 18