xref: /PHP-8.2/ext/date/tests/bug66545.phpt (revision c8a6a8ab)
1--TEST--
2Bug #66545 (DateTime)
3--INI--
4date.timezone=Europe/Paris
5--FILE--
6<?php
7
8$debut = mktime(0, 0, 0, 10, 27, 2013);
9$fin = mktime(23, 59, 59, 11, 10, 2013);
10
11$d1 = new DateTime('now',new DateTimeZone('Europe/Paris'));
12$d2 = new DateTime('now',new DateTimeZone('Europe/Paris'));
13$d1->setTimestamp($debut);
14$d2->setTimestamp($fin);
15$diff = $d1->diff($d2);
16print_r($diff);
17?>
18--EXPECT--
19DateInterval Object
20(
21    [y] => 0
22    [m] => 0
23    [d] => 14
24    [h] => 23
25    [i] => 59
26    [s] => 59
27    [f] => 0
28    [invert] => 0
29    [days] => 14
30    [from_string] =>
31)
32