xref: /PHP-8.3/ext/date/tests/bug70810.phpt (revision 3cfbbf29)
1--TEST--
2Bug #70810: DateInterval equals every other DateInterval
3--FILE--
4<?php
5
6$i1 = new DateInterval('P1D');
7$i2 = new DateInterval('PT1H');
8var_dump($i1 == $i2);
9var_dump($i1 < $i2);
10var_dump($i1 > $i2);
11
12$i2 = new DateInterval('P1D');
13var_dump($i1 == $i2);
14var_dump($i1 < $i2);
15var_dump($i1 > $i2);
16
17?>
18--EXPECTF--
19Warning: Cannot compare DateInterval objects in %s on line %d
20bool(false)
21
22Warning: Cannot compare DateInterval objects in %s on line %d
23bool(false)
24
25Warning: Cannot compare DateInterval objects in %s on line %d
26bool(false)
27
28Warning: Cannot compare DateInterval objects in %s on line %d
29bool(false)
30
31Warning: Cannot compare DateInterval objects in %s on line %d
32bool(false)
33
34Warning: Cannot compare DateInterval objects in %s on line %d
35bool(false)
36