3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo strtotime("+12 months"); $d1 = new \Datetime('2017-6-1'); $d2 = new \Datetime('2017-7-1'); $diff = $d1->diff($d2); echo sprintf('%d Month\\s', $diff->m) . PHP_EOL; echo sprintf('...But %d Day\\s', $diff->d) . PHP_EOL;

preferences:
42.12 ms | 402 KiB | 5 Q