xref: /PHP-7.2/ext/date/tests/bug68078.phpt (revision 1bbbc47e)
1--TEST--
2Comparing datetime objects should account for microseconds
3--FILE--
4<?php
5
6date_default_timezone_set('UTC');
7$date1 = DateTime::createFromFormat('U.u', '1448889063.3531');
8$date2 = DateTime::createFromFormat('U.u', '1448889063.5216');
9$date3 = DateTime::createFromFormat('U.u', '1448889063.5216');
10
11var_dump($date1 == $date2);
12var_dump($date1 < $date2);
13var_dump($date2 > $date1);
14var_dump($date2 == $date3);
15--EXPECT--
16bool(false)
17bool(true)
18bool(true)
19bool(true)
20