gmmktime_error.phpt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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_arg1 = 10;
  20. $extra_arg2 = 10;
  21. var_dump( gmmktime($hour, $min, $sec, $mon, $day, $year, $extra_arg1) );
  22. var_dump( gmmktime($hour, $min, $sec, $mon, $day, $year, $extra_arg1, $extra_arg2) );
  23. ?>
  24. ===DONE===
  25. --EXPECTF--
  26. *** Testing gmmktime() : error conditions ***
  27. -- Testing gmmktime() function with more than expected no. of arguments --
  28. Deprecated: gmmktime(): The is_dst parameter is deprecated in %s on line %d
  29. int(1218182888)
  30. Warning: gmmktime() expects at most 7 parameters, 8 given in %s on line %d
  31. bool(false)
  32. ===DONE===