When I var_dump
a DateInterval
object, as in this example from the PHP documentation:
$interval = new DateInterval('P2Y4DT6H8M');
var_dump($interval);
I see several properties that are not described in the manual.
PHP Manual My var_dump
---------------------------- ------------------------------------------
object(DateInterval)#1 (8) { object(DateInterval)[1]
["y"]=> int(2) public 'y' => int(2)
["m"]=> int(0) public 'm' => int(0)
["d"]=> int(4) public 'd' => int(4)
["h"]=> int(6) public 'h' => int(6)
["i"]=> int(8) public 'i' => int(8)
["s"]=> int(0) public 's' => int(0)
public 'weekday' => int 0
public 'weekday_behavior' => int 0
public 'first_last_day_of' => int 0
["invert"]=> int(0) public 'invert' => int 0
["days"]=> bool(false) public 'days' => boolean false
public 'special_type' => int 0
public 'special_amount' => int 0
public 'have_weekday_relative' => int 0
public 'have_special_relative' => int 0
}
I thought it might be a difference between PHP versions, so I ran it at 3v4l.org and it looks kind of inconsistent as to which older PHP versions produce which output (various 5.3 and 5.4 versions produce one or the other).
I would like to know what 'have_special_relative'
etc. are and what they are intended to be used for, but I have not had much luck with my googling so far. I've also experimented with quite a few different intervals and have not been able to make any of the unknown properties != 0.
Can someone point me in the right direction to figure this out?