- print_r: documentation ( source)
<?php
$tz = new DateTimeZone('Europe/Amsterdam');
$now = new DateTime('2015-10-01', $tz);
$then = new DateTime('2015-01-01', $tz);
$diff = $now->diff($then);
print_r($diff);
$now = new DateTime('2015-09-01', $tz);
$then = new DateTime('2015-01-01', $tz);
$diff = $now->diff($then);
print_r($diff);
$now = new DateTime('2015-11-01', $tz);
$then = new DateTime('2015-01-01', $tz);
$diff = $now->diff($then);
print_r($diff);