3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myDate = DateTime::createFromFormat('mdY', '06102013'); echo $myDate->format('d.m.Y'), PHP_EOL; echo $myDate->format('U'), PHP_EOL; echo time(), PHP_EOL; $start = DateTime::createFromFormat('m/d/Y', '10/19/2015'); echo $start->format('Y-m-d 00:00:00'), PHP_EOL; echo $start->format('U'), PHP_EOL; $end = clone $start; echo $end->modify( '+1 day' ), PHP_EOL; echo $end->format('Y-m-d 00:00:00'), PHP_EOL; $start = DateTime::createFromFormat('m/d/Y', '10/20/2015'); echo $start->format('Y-m-d 00:00:00'), PHP_EOL; echo $start->format('U'), PHP_EOL;
Output for 7.4.0
10.06.2013 1370885000 1444843400 2015-10-19 00:00:00 1445275400 Fatal error: Uncaught Error: Object of class DateTime could not be converted to string in /in/tWA3o:12 Stack trace: #0 {main} thrown in /in/tWA3o on line 12
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12
10.06.2013 1370885000 1444843400 2015-10-19 00:00:00 1445275400 Recoverable fatal error: Object of class DateTime could not be converted to string in /in/tWA3o on line 12
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.37, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20
10.06.2013 1370885000 1444843400 2015-10-19 00:00:00 1445275400 Catchable fatal error: Object of class DateTime could not be converted to string in /in/tWA3o on line 12
Process exited with code 255.

preferences:
111.87 ms | 402 KiB | 161 Q