2010-03-07 15:26:39 +00:00
|
|
|
--TEST--
|
|
|
|
Bug #49778 (DateInterval::format("%a") is always zero when an interval is created from an ISO string)
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$i=new DateInterval('P7D');
|
|
|
|
var_dump($i);
|
|
|
|
echo $i->format("%d"), "\n";
|
|
|
|
echo $i->format("%a"), "\n";
|
|
|
|
?>
|
2016-10-05 15:24:15 +00:00
|
|
|
--EXPECTF--
|
|
|
|
object(DateInterval)#%d (16) {
|
2010-03-07 15:26:39 +00:00
|
|
|
["y"]=>
|
|
|
|
int(0)
|
|
|
|
["m"]=>
|
|
|
|
int(0)
|
|
|
|
["d"]=>
|
|
|
|
int(7)
|
|
|
|
["h"]=>
|
|
|
|
int(0)
|
|
|
|
["i"]=>
|
|
|
|
int(0)
|
|
|
|
["s"]=>
|
|
|
|
int(0)
|
2016-10-05 15:24:15 +00:00
|
|
|
["f"]=>
|
|
|
|
float(0)
|
2013-03-15 15:59:54 +00:00
|
|
|
["weekday"]=>
|
|
|
|
int(0)
|
|
|
|
["weekday_behavior"]=>
|
|
|
|
int(0)
|
|
|
|
["first_last_day_of"]=>
|
|
|
|
int(0)
|
2010-03-07 15:26:39 +00:00
|
|
|
["invert"]=>
|
|
|
|
int(0)
|
|
|
|
["days"]=>
|
|
|
|
bool(false)
|
2013-03-15 15:59:54 +00:00
|
|
|
["special_type"]=>
|
|
|
|
int(0)
|
|
|
|
["special_amount"]=>
|
2013-06-10 15:48:13 +00:00
|
|
|
int(0)
|
2013-03-15 15:59:54 +00:00
|
|
|
["have_weekday_relative"]=>
|
|
|
|
int(0)
|
|
|
|
["have_special_relative"]=>
|
|
|
|
int(0)
|
2010-03-07 15:26:39 +00:00
|
|
|
}
|
|
|
|
7
|
|
|
|
(unknown)
|