3v4l.org

run code in 300+ PHP versions simultaneously
<?php $day = date("d"); $datetime = new DateTime('tomorrow'); $day_tomorrow = date("d", strtotime($datetime)); echo $day; echo $datetime; echo $day_tomorrow;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught TypeError: strtotime(): Argument #1 ($datetime) must be of type string, DateTime given in /in/5eTfJ:5 Stack trace: #0 /in/5eTfJ(5): strtotime(Object(DateTime)) #1 {main} thrown in /in/5eTfJ on line 5
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: strtotime() expects parameter 1 to be string, object given in /in/5eTfJ on line 5 09 Fatal error: Uncaught Error: Object of class DateTime could not be converted to string in /in/5eTfJ:7 Stack trace: #0 {main} thrown in /in/5eTfJ on line 7
Process exited with code 255.
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
Warning: strtotime() expects parameter 1 to be string, object given in /in/5eTfJ on line 5 09 Recoverable fatal error: Object of class DateTime could not be converted to string in /in/5eTfJ on line 7
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33
Warning: strtotime() expects parameter 1 to be string, object given in /in/5eTfJ on line 5 09 Catchable fatal error: Object of class DateTime could not be converted to string in /in/5eTfJ on line 7
Process exited with code 255.

preferences:
200.52 ms | 402 KiB | 290 Q