bug46268.phpt 576 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #46268 (When call DateTime#setTime, it seems to be called the last modify method too)
  3. --FILE--
  4. <?php
  5. date_default_timezone_set('Asia/Tokyo');
  6. $now = new DateTime('2008-10-10 01:02:03');
  7. echo $now->format("Y-m-d H:i:s") . PHP_EOL;
  8. $now->modify("1 day");
  9. echo $now->format("Y-m-d H:i:s") . PHP_EOL;
  10. $now->modify("1 hour");
  11. echo $now->format("Y-m-d H:i:s") . PHP_EOL;
  12. $now->setTime(0, 0, 0);
  13. //date_time_set($now, 0, 0, 0);
  14. echo $now->format("Y-m-d H:i:s") . PHP_EOL;
  15. ?>
  16. --EXPECT--
  17. 2008-10-10 01:02:03
  18. 2008-10-11 01:02:03
  19. 2008-10-11 02:02:03
  20. 2008-10-11 00:00:00