strftime_error.phpt 919 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Test strftime() function : error conditions
  3. --FILE--
  4. <?php
  5. /* Prototype : string strftime(string format [, int timestamp])
  6. * Description: Format a local time/date according to locale settings
  7. * Source code: ext/date/php_date.c
  8. * Alias to functions:
  9. */
  10. echo "*** Testing strftime() : error conditions ***\n";
  11. date_default_timezone_set("Asia/Calcutta");
  12. //Test strftime with one more than the expected number of arguments
  13. echo "\n-- Testing strftime() function with more than expected no. of arguments --\n";
  14. $format = '%b %d %Y %H:%M:%S';
  15. $timestamp = mktime(8, 8, 8, 8, 8, 2008);
  16. $extra_arg = 10;
  17. var_dump( strftime($format, $timestamp, $extra_arg) );
  18. ?>
  19. ===DONE===
  20. --EXPECTF--
  21. *** Testing strftime() : error conditions ***
  22. -- Testing strftime() function with more than expected no. of arguments --
  23. Warning: strftime() expects at most 2 parameters, 3 given in %s on line %d
  24. bool(false)
  25. ===DONE===