idate_variation3.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Test idate() function : usage variation - Passing higher positive and negetive float values to timestamp.
  3. --FILE--
  4. <?php
  5. /* Prototype : int idate(string format [, int timestamp])
  6. * Description: Format a local time/date as integer
  7. * Source code: ext/date/php_date.c
  8. * Alias to functions:
  9. */
  10. echo "*** Testing idate() : usage variation ***\n";
  11. // Initialise function arguments not being substituted (if any)
  12. $format = 'Y';
  13. date_default_timezone_set("Asia/Calcutta");
  14. echo "\n-- Testing idate() function with float 12.3456789000e10 to timestamp --\n";
  15. $timestamp = 12.3456789000e10;
  16. var_dump( idate($format, $timestamp) );
  17. echo "\n-- Testing idate() function with float -12.3456789000e10 to timestamp --\n";
  18. $timestamp = -12.3456789000e10;
  19. var_dump( idate($format, $timestamp) );
  20. ?>
  21. ===DONE===
  22. --EXPECTREGEX--
  23. \*\*\* Testing idate\(\) : usage variation \*\*\*
  24. -- Testing idate\(\) function with float 12.3456789000e10 to timestamp --
  25. int\((1935|5882)\)
  26. -- Testing idate\(\) function with float -12.3456789000e10 to timestamp --
  27. int\((2004|1901|-1943)\)
  28. ===DONE===