getdate_variation7.phpt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. --TEST--
  2. Test getdate() function : usage variation - Passing high positive and negative float values to timestamp.
  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() : usage variation ***\n";
  11. date_default_timezone_set("Asia/Calcutta");
  12. echo "\n-- Testing getdate() function by passing float 12.3456789000e10 value to timestamp --\n";
  13. $timestamp = 12.3456789000e10;
  14. var_dump( getdate($timestamp) );
  15. echo "\n-- Testing getdate() function by passing float -12.3456789000e10 value to timestamp --\n";
  16. $timestamp = -12.3456789000e10;
  17. var_dump( getdate($timestamp) );
  18. ?>
  19. ===DONE===
  20. --EXPECTREGEX--
  21. \*\*\* Testing getdate\(\) : usage variation \*\*\*
  22. -- Testing getdate\(\) function by passing float 12.3456789000e10 value to timestamp --
  23. array\(11\) {
  24. \["seconds"\]=>
  25. int\((.+)\)
  26. \["minutes"\]=>
  27. int\((43|0)\)
  28. \["hours"\]=>
  29. int\((10|6)\)
  30. \["mday"\]=>
  31. int\((26|11)\)
  32. \["wday"\]=>
  33. int\((2|6)\)
  34. \["mon"\]=>
  35. int\(3\)
  36. \["year"\]=>
  37. int\((1935|5882)\)
  38. \["yday"\]=>
  39. int\((84|69)\)
  40. \["weekday"\]=>
  41. string\((7|8)\) "(Tuesday|Saturday)"
  42. \["month"\]=>
  43. string\(5\) "March"
  44. \[0\]=>
  45. int\((-1097262584|123456789000)\)
  46. }
  47. -- Testing getdate\(\) function by passing float -12.3456789000e10 value to timestamp --
  48. array\(11\) {
  49. \["seconds"\]=>
  50. int\((.+)\)
  51. \["minutes"\]=>
  52. int\((39|23)\)
  53. \["hours"\]=>
  54. int\((0|2|5)\)
  55. \["mday"\]=>
  56. int\((9|14|23)\)
  57. \["wday"\]=>
  58. int\((0|6)\)
  59. \["mon"\]=>
  60. int\((10|12)\)
  61. \["year"\]=>
  62. int\((2004|1901|-1943)\)
  63. \["yday"\]=>
  64. int\((282|347|295)\)
  65. \["weekday"\]=>
  66. string\((6|8)\) "(Sunday|Saturday)"
  67. \["month"\]=>
  68. string\((7|8)\) "(October|December)"
  69. \[0\]=>
  70. int\((1097262584|-2147483648|-123456789000)\)
  71. }
  72. ===DONE===