3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $lastDate = '1452532797'; $interval = 'P0Y0M1D'; $lastJob = new \Datetime(); $lastJob->setTimestamp($lastDate); echo ('Last Sent: '.$lastJob->format('Y/m/d')); echo " "; $interval = new DateInterval($interval); echo ('Interval: '.$interval->format('%y years, %m months, %d days')); echo " "; $currentJob = new \Datetime(); echo ($lastJob->diff($currentJob))->format('%y years, %m months, %d days'); echo " "; echo $lastJob->add($interval)->format('%y years, %m months, %d days');
based on HsNJB
Output for 7.0.20 - 7.2.0
Last Sent: 2016/01/11 Interval: 0 years, 0 months, 1 days 0 years, 0 months, 1 days %16 16Europe/AmsterdampmTue, 12 Jan 2016 18:19:57 +010057, %01 0120161310657, %12 12pm1657
Output for 7.0.6
Last Sent: 2016/01/11 Interval: 0 years, 0 months, 1 days 0 years, 4 months, 9 days %16 16Europe/AmsterdampmTue, 12 Jan 2016 18:19:57 +010057, %01 0120161310657, %12 12pm1657
Output for 7.0.5
Last Sent: 2016/01/11 Interval: 0 years, 0 months, 1 days 0 years, 2 months, 22 days %16 16Europe/AmsterdampmTue, 12 Jan 2016 18:19:57 +010057, %01 0120161310657, %12 12pm1657
Output for 7.0.4
Last Sent: 2016/01/11 Interval: 0 years, 0 months, 1 days 0 years, 1 months, 28 days %16 16Europe/AmsterdampmTue, 12 Jan 2016 18:19:57 +010057, %01 0120161310657, %12 12pm1657
Output for 7.0.3
Last Sent: 2016/01/11 Interval: 0 years, 0 months, 1 days 0 years, 2 months, 7 days %16 16Europe/AmsterdampmTue, 12 Jan 2016 18:19:57 +010057, %01 0120161310657, %12 12pm1657
Output for 7.0.2
Last Sent: 2016/01/11 Interval: 0 years, 0 months, 1 days 0 years, 2 months, 11 days %16 16Europe/AmsterdampmTue, 12 Jan 2016 18:19:57 +010057, %01 0120161310657, %12 12pm1657
Output for 7.0.1
Last Sent: 2016/01/11 Interval: 0 years, 0 months, 1 days 0 years, 2 months, 12 days %16 16Europe/AmsterdampmTue, 12 Jan 2016 18:19:57 +010057, %01 0120161310657, %12 12pm1657
Output for 7.0.0
Last Sent: 2016/01/11 Interval: 0 years, 0 months, 1 days 0 years, 2 months, 15 days %16 16Europe/AmsterdampmTue, 12 Jan 2016 18:19:57 +010057, %01 0120161310657, %12 12pm1657
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ',' or ';' in /in/uPKCD on line 15
Process exited with code 255.
Output for 5.3.29

Process exited with code 137.
Output for 5.3.21 - 5.3.28
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/uPKCD on line 15
Process exited with code 255.