bug77243-001.phpt 719 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Bug #77243 (Weekdays are calculated incorrectly for negative years)
  3. --SKIPIF--
  4. <?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
  5. --FILE--
  6. <?php
  7. date_default_timezone_set('UTC');
  8. $time=-62167046400; // 0000-01-03 0-01-1
  9. for ($i = -10; $i < 10; $i++ )
  10. {
  11. echo date('Y-m-d o-W-N', $time + ($i * 86400)), "\n";
  12. }
  13. ?>
  14. --EXPECT--
  15. -0001-12-24 -1-51-5
  16. -0001-12-25 -1-51-6
  17. -0001-12-26 -1-51-7
  18. -0001-12-27 -1-52-1
  19. -0001-12-28 -1-52-2
  20. -0001-12-29 -1-52-3
  21. -0001-12-30 -1-52-4
  22. -0001-12-31 -1-52-5
  23. 0000-01-01 -1-52-6
  24. 0000-01-02 -1-52-7
  25. 0000-01-03 0-01-1
  26. 0000-01-04 0-01-2
  27. 0000-01-05 0-01-3
  28. 0000-01-06 0-01-4
  29. 0000-01-07 0-01-5
  30. 0000-01-08 0-01-6
  31. 0000-01-09 0-01-7
  32. 0000-01-10 0-02-1
  33. 0000-01-11 0-02-2
  34. 0000-01-12 0-02-3