3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $first = new \DateTime('first sec of this year'); //$last = new \DateTime('last day of this year'); $last = $first; echo $first->format('Y-m-d H:i:s') . ' to ' . $last->format('Y-m-d H:i:s');
based on 49PKe
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (first sec of this year) at position 10 (o): The timezone could not be found in the database in /in/adC3L:2 Stack trace: #0 /in/adC3L(2): DateTime->__construct('first sec of th...') #1 {main} thrown in /in/adC3L on line 2
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (first sec of this year) at position 10 (o): The timezone could not be found in the database' in /in/adC3L:2 Stack trace: #0 /in/adC3L(2): DateTime->__construct('first sec of th...') #1 {main} thrown in /in/adC3L on line 2
Process exited with code 255.