ReflectionMethod_006.phpt 549 B

1234567891011121314151617181920212223
  1. --TEST--
  2. ReflectionMethod methods - wrong num args
  3. --CREDITS--
  4. Robin Fernandes <robinf@php.net>
  5. Steve Seear <stevseea@php.net>
  6. --FILE--
  7. <?php
  8. try {
  9. new ReflectionMethod();
  10. } catch (ArgumentCountError $re) {
  11. echo "Ok - ".$re->getMessage().PHP_EOL;
  12. }
  13. try {
  14. new ReflectionMethod('a', 'b', 'c');
  15. } catch (ArgumentCountError $re) {
  16. echo "Ok - ".$re->getMessage().PHP_EOL;
  17. }
  18. ?>
  19. --EXPECT--
  20. Ok - ReflectionMethod::__construct() expects at least 1 argument, 0 given
  21. Ok - ReflectionMethod::__construct() expects at most 2 arguments, 3 given