3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $month = 1; $year = 2016; $firstDay = new DateTime("first day of {$month} {$year}"); echo $firstDay->format('Y-m-d');
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (first day of 1 2016) at position 13 (1): Unexpected character in /in/TXmjQ:6 Stack trace: #0 /in/TXmjQ(6): DateTime->__construct('first day of 1 ...') #1 {main} thrown in /in/TXmjQ on line 6
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (first day of 1 2016) at position 13 (1): Unexpected character' in /in/TXmjQ:6 Stack trace: #0 /in/TXmjQ(6): DateTime->__construct('first day of 1 ...') #1 {main} thrown in /in/TXmjQ on line 6
Process exited with code 255.