3v4l.org

run code in 300+ PHP versions simultaneously
<?php $firstDayJuly2016 = new DateTime("first day of July 2016"); // The following returns // object(DateTime) // public 'date' => string '2016-07-02 00:00:00' (length=19) var_dump($firstDayJuly2016); $fourthDayJuly2016 = new DateTime("July 2016 +4 days"); // The following returns // object(DateTime) // public 'date' => string '2016-07-05 00:00:00' (length=19) var_dump($fourthDayJuly2016);

preferences:
26.23 ms | 404 KiB | 5 Q