gmmktime_variation8.phpt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. Test gmmktime() function : usage variation - Passing octal and hexadecimal values to arguments.
  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() : usage variation ***\n";
  11. // Initialise all required variables
  12. $hour = 010;
  13. $min = 010;
  14. $sec = 010;
  15. $mon = 010;
  16. $day = 010;
  17. $year = 03730;
  18. echo "\n-- Testing gmmktime() function with supplying octal values to arguments --\n";
  19. var_dump( gmmktime($hour, $min, $sec, $mon, $day, $year) );
  20. // Initialise all required variables
  21. $hour = 0x8;
  22. $min = 0x8;
  23. $sec = 0x8;
  24. $mon = 0x8;
  25. $day = 0x8;
  26. $year = 0x7D8;
  27. echo "\n-- Testing gmmktime() function with supplying hexa decimal values to arguments --\n";
  28. var_dump( gmmktime($hour, $min, $sec, $mon, $day, $year) );
  29. ?>
  30. ===DONE===
  31. --EXPECTF--
  32. *** Testing gmmktime() : usage variation ***
  33. -- Testing gmmktime() function with supplying octal values to arguments --
  34. int(1218182888)
  35. -- Testing gmmktime() function with supplying hexa decimal values to arguments --
  36. int(1218182888)
  37. ===DONE===