xref: /PHP-8.2/ext/date/tests/bug60774.phpt (revision cae1d4ad)
1--TEST--
2Bug #60774 (DateInterval::format("%a") is always zero when an interval is created using the createFromDateString method)
3--FILE--
4<?php
5$i= DateInterval::createFromDateString('2 days');
6var_dump($i);
7echo $i->format("%d"), "\n";
8echo $i->format("%a"), "\n";
9?>
10--EXPECTF--
11object(DateInterval)#1 (%d) {
12  ["from_string"]=>
13  bool(true)
14  ["date_string"]=>
15  string(6) "2 days"
16}
172
18(unknown)
19