3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2014-01-07', new DateTimeZone('UTC')); $end = clone $start; $start->sub(new DateInterval('P1M')); print_r($end->diff($start)); print_r($start->diff($end));

preferences:
42.52 ms | 402 KiB | 5 Q