3v4l.org

run code in 300+ PHP versions simultaneously
<?php use \DateTime; $date = '2015-10-10 10:10:10'; $from = new DateTime($date); echo $from ?>
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: The use statement with non-compound name 'DateTime' has no effect in /in/rkJtP on line 2 Fatal error: Uncaught Error: Object of class DateTime could not be converted to string in /in/rkJtP:6 Stack trace: #0 {main} thrown in /in/rkJtP on line 6
Process exited with code 255.
Output for 7.1.0 - 7.1.24, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33
Warning: The use statement with non-compound name 'DateTime' has no effect in /in/rkJtP on line 2 Recoverable fatal error: Object of class DateTime could not be converted to string in /in/rkJtP on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.32
Warning: The use statement with non-compound name 'DateTime' has no effect in /in/rkJtP on line 2 Catchable fatal error: Object of class DateTime could not be converted to string in /in/rkJtP on line 6
Process exited with code 255.
Output for 5.5.25 - 5.5.38, 5.6.9 - 5.6.38
Warning: The use statement with non-compound name 'DateTime' has no effect in /in/rkJtP on line 2 Catchable fatal error: Object of class DateTime could not be converted to string in /in/rkJtP on line 7
Process exited with code 255.
Output for 5.5.0 - 5.5.24, 5.6.0 - 5.6.8
Catchable fatal error: Object of class DateTime could not be converted to string in /in/rkJtP on line 7
Process exited with code 255.

preferences:
200.06 ms | 402 KiB | 289 Q