3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateTime = new DateTime('2008-09-22'); echo $dateTime->format('U'); echo PHP_EOL; $date = DateTime::createFromFormat('d-m-Y', '22-09-2008'); echo $date->format('U');
Output for 5.3.0 - 5.3.22, 5.4.0 - 5.4.12, 7.2.29 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.24, 8.1.0 - 8.1.11
1222034400 1222099026
Output for 7.3.32 - 7.3.33, 7.4.26, 8.0.13
1222041600 1222102626
Output for 5.2.10 - 5.2.17
1222034400 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/o8XIr on line 7
Process exited with code 255.
Output for 5.2.0 - 5.2.9
1222034400 Fatal error: Call to undefined method DateTime::createfromformat() in /in/o8XIr on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/o8XIr on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/o8XIr on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/o8XIr on line 2

preferences:
18.94 ms | 415 KiB | 5 Q