3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $queuedTime = "2011-03-17 06:42:10"; $b2 = new DateTime($queuedTime); $b1 = date_sub($queuedTime,date_interval_create_from_date_string("100 minutes")); $b1 = $b1->format("Y-m-d H:i:s"); $between = " AND BETWEEN " . $b1 . " AND " . $b2; echo $between; ?>
Output for 7.0.0 - 7.1.0
Warning: date_sub() expects parameter 1 to be DateTime, string given in /in/Hb67a on line 6 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/Hb67a:7 Stack trace: #0 {main} thrown in /in/Hb67a on line 7
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Catchable fatal error: Argument 1 passed to date_sub() must be an instance of DateTime, string given in /in/Hb67a on line 6
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Warning: date_sub() expects parameter 1 to be DateTime, string given in /in/Hb67a on line 6 Fatal error: Call to a member function format() on boolean in /in/Hb67a on line 7
Process exited with code 255.
Output for 5.3.0 - 5.5.35
Warning: date_sub() expects parameter 1 to be DateTime, string given in /in/Hb67a on line 6 Fatal error: Call to a member function format() on a non-object in /in/Hb67a on line 7
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined function date_sub() in /in/Hb67a on line 6
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Hb67a on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/Hb67a on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/Hb67a on line 4