3v4l.org

run code in 300+ PHP versions simultaneously
<?php $di = (new DateTime('2012-10-20'))->diff(new DateTime('2012-12-10')); print_r($di); print_r((new DateTime('2015-09-30'))->add($di)); $di2 = (new DateTime('2015-09-30'))->diff(new DateTime(date('r', $_SERVER['REQUEST_TIME']))); print_r($di2);

preferences:
31.52 ms | 402 KiB | 5 Q