gh8730.phpt 634 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Bug GH-8730 (DateTime::diff miscalculation is same time zone of different type)
  3. --FILE--
  4. <?php
  5. $foo = new DateTime('2022-06-08 09:15:00', new DateTimeZone('-04:00'));
  6. $bar = new DateTime('2022-06-08 09:15:00', new DateTimeZone('US/Eastern'));
  7. print_r($foo->diff($bar));
  8. ?>
  9. --EXPECT--
  10. DateInterval Object
  11. (
  12. [y] => 0
  13. [m] => 0
  14. [d] => 0
  15. [h] => 0
  16. [i] => 0
  17. [s] => 0
  18. [f] => 0
  19. [weekday] => 0
  20. [weekday_behavior] => 0
  21. [first_last_day_of] => 0
  22. [invert] => 0
  23. [days] => 0
  24. [special_type] => 0
  25. [special_amount] => 0
  26. [have_weekday_relative] => 0
  27. [have_special_relative] => 0
  28. )