3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime('2016-03-30 15:20:00'); $unixtime = strtotime($date, strtotime("next Monday")); echo $time = date('Y-m-d H:i:s',$unixtime);
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught TypeError: strtotime(): Argument #1 ($datetime) must be of type string, DateTime given in /in/QBWJa:4 Stack trace: #0 /in/QBWJa(4): strtotime(Object(DateTime), 1459720800) #1 {main} thrown in /in/QBWJa on line 4
Process exited with code 255.
Output for 8.0.13
Fatal error: Uncaught TypeError: strtotime(): Argument #1 ($datetime) must be of type string, DateTime given in /in/QBWJa:4 Stack trace: #0 /in/QBWJa(4): strtotime(Object(DateTime), 1459728000) #1 {main} thrown in /in/QBWJa on line 4
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.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Warning: strtotime() expects parameter 1 to be string, object given in /in/QBWJa on line 4 1970-01-01 01:00:00
Output for 7.3.32 - 7.3.33
Warning: strtotime() expects parameter 1 to be string, object given in /in/QBWJa on line 4 1970-01-01 00:00:00

preferences:
190.28 ms | 401 KiB | 238 Q