ReflectionFunction_construct.001.phpt 722 B

1234567891011121314151617181920212223
  1. --TEST--
  2. ReflectionFunction constructor errors
  3. --CREDITS--
  4. Robin Fernandes <robinf@php.net>
  5. Steve Seear <stevseea@php.net>
  6. --FILE--
  7. <?php
  8. $a = new ReflectionFunction(array(1, 2, 3));
  9. try {
  10. $a = new ReflectionFunction('nonExistentFunction');
  11. } catch (Exception $e) {
  12. echo $e->getMessage();
  13. }
  14. $a = new ReflectionFunction();
  15. $a = new ReflectionFunction(1, 2);
  16. ?>
  17. --EXPECTF--
  18. Warning: ReflectionFunction::__construct() expects parameter 1 to be string, array given in %s on line %d
  19. Function nonExistentFunction() does not exist
  20. Warning: ReflectionFunction::__construct() expects exactly 1 parameter, 0 given in %s on line %d
  21. Warning: ReflectionFunction::__construct() expects exactly 1 parameter, 2 given in %s on line %d