xref: /PHP-8.0/ext/date/tests/bug65548.phpt (revision d7f5f1ef)
1--TEST--
2Test for bug #65548: Comparison for DateTimeImmutable doesn't work
3--CREDITS--
4Boro Sitnikovski <buritomath@yahoo.com>
5--INI--
6date.timezone = UTC
7--FILE--
8<?php
9$iToday = new DateTimeImmutable('today');
10$iTomorrow = new DateTimeImmutable('tomorrow');
11
12$mToday = new DateTime('today');
13$mTomorrow = new DateTime('tomorrow');
14
15var_dump($iToday < $iTomorrow);
16var_dump($iToday == $iTomorrow);
17var_dump($iToday > $iTomorrow);
18
19var_dump($iToday == $mToday);
20var_dump($iToday === $mToday);
21
22var_dump($iToday < $mTomorrow);
23var_dump($iToday == $mTomorrow);
24var_dump($iToday > $mTomorrow);
25?>
26--EXPECT--
27bool(true)
28bool(false)
29bool(false)
30bool(true)
31bool(false)
32bool(true)
33bool(false)
34bool(false)
35