If you'd like to persist an interval object in a DB it could be handy to implement the __toString() method. A formatted interval value can be easier to read by a human than the output of serialize. Here's an example:
<?php
namespace App;
class DateInterval extends \DateInterval
{
public function __toString()
{
return $this->format('P%yY%mM%dDT%hH%iM%sS');
}
}
$interval1 = new DateInterval('P1Y');
$interval2 = new DateInterval(strval($interval1));
assert($interval1 == $interval2);