getdate_error.phpt 831 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Test getdate() function : error conditions
  3. --FILE--
  4. <?php
  5. /* Prototype : array getdate([int timestamp])
  6. * Description: Get date/time information
  7. * Source code: ext/date/php_date.c
  8. * Alias to functions:
  9. */
  10. echo "*** Testing getdate() : error conditions ***\n";
  11. //Set the default time zone
  12. date_default_timezone_set("America/Chicago");
  13. //Test getdate with one more than the expected number of arguments
  14. echo "\n-- Testing getdate() function with more than expected no. of arguments --\n";
  15. $timestamp = 10;
  16. $extra_arg = 10;
  17. var_dump( getdate($timestamp, $extra_arg) );
  18. ?>
  19. ===DONE===
  20. --EXPECTF--
  21. *** Testing getdate() : error conditions ***
  22. -- Testing getdate() function with more than expected no. of arguments --
  23. Warning: getdate() expects at most 1 parameter, 2 given in %s on line %d
  24. bool(false)
  25. ===DONE===