badargs.phpt 673 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Check that bad arguments return the same
  3. --EXTENSIONS--
  4. intl
  5. --FILE--
  6. <?php
  7. $funcs = get_extension_funcs("intl");
  8. function ignore_err() {}
  9. set_error_handler("ignore_err");
  10. $arg = new stdClass();
  11. foreach($funcs as $func) {
  12. $rfunc = new ReflectionFunction($func);
  13. if($rfunc->getNumberOfRequiredParameters() == 0) {
  14. continue;
  15. }
  16. try {
  17. $res = $func($arg);
  18. } catch (Exception $e) {
  19. continue;
  20. } catch (Error $e) {
  21. continue;
  22. }
  23. if($res != false) {
  24. echo "$func: ";
  25. var_dump($res);
  26. }
  27. }
  28. echo "OK!\n";
  29. ?>
  30. --EXPECT--
  31. OK!