3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime('now'); $firstOfMonth = $date->modify('1st of month')->format(DATE_ISO8601); $lastOfMonth = $date->modify('last day of month')->format(DATE_ISO8601); var_dump(array($firstOfMonth, $lastOfMonth));

preferences:
45.13 ms | 402 KiB | 5 Q