gmmktime_error.phpt 898 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Test gmmktime() function : error conditions
  3. --FILE--
  4. <?php
  5. /* Prototype : int gmmktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]])
  6. * Description: Get UNIX timestamp for a GMT date
  7. * Source code: ext/date/php_date.c
  8. * Alias to functions:
  9. */
  10. echo "*** Testing gmmktime() : error conditions ***\n";
  11. //Test gmmktime with one more than the expected number of arguments
  12. echo "\n-- Testing gmmktime() function with more than expected no. of arguments --\n";
  13. $hour = 8;
  14. $min = 8;
  15. $sec = 8;
  16. $mon = 8;
  17. $day = 8;
  18. $year = 2008;
  19. $extra_arg = 10;
  20. var_dump( gmmktime($hour, $min, $sec, $mon, $day, $year, $extra_arg) );
  21. ?>
  22. ===DONE===
  23. --EXPECTF--
  24. *** Testing gmmktime() : error conditions ***
  25. -- Testing gmmktime() function with more than expected no. of arguments --
  26. Warning: gmmktime() expects at most 6 parameters, 7 given in %s on line %d
  27. bool(false)
  28. ===DONE===