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 $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/6SlCp:5 Stack trace: #0 /in/6SlCp(5): strtotime(Object(DateTime)) #1 {main} thrown in /in/6SlCp on line 5
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.6 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: strtotime() expects parameter 1 to be string, object given in /in/6SlCp on line 5 0901

preferences:
199.05 ms | 403 KiB | 248 Q