ReflectionFunction_getClosure_error.phpt 719 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Test ReflectionFunction::getClosure() function : error functionality
  3. --FILE--
  4. <?php
  5. /* Prototype : public mixed ReflectionFunction::getClosure()
  6. * Description: Returns a dynamically created closure for the function
  7. * Source code: ext/reflection/php_reflection.c
  8. * Alias to functions:
  9. */
  10. echo "*** Testing ReflectionFunction::getClosure() : error conditions ***\n";
  11. function foo()
  12. {
  13. var_dump( "Inside foo function" );
  14. }
  15. $func = new ReflectionFunction( 'foo' );
  16. $closure = $func->getClosure('bar');
  17. ?>
  18. ===DONE===
  19. --EXPECTF--
  20. *** Testing ReflectionFunction::getClosure() : error conditions ***
  21. Warning: ReflectionFunction::getClosure() expects exactly 0 parameters, 1 given in %s on line %d
  22. ===DONE===