3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $sStartDate = DateTime::createFromFormat('2013-13-05 21:56:00'); $sEndDate = DateTime::createFromFormat('2013-15-05 21:56:01'); $diff = date_diff($sStartDate, $sEndDate, true); $days = $diff->format('%a'); echo $days; if (1 <= $days) { echo '24 hours or more.'; } else { echo 'less than 24 hours.'; }
based on ASYgl
Output for 7.0.0 - 7.2.6
Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 3 Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 4 Warning: date_diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/BLgHY on line 6 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/BLgHY:8 Stack trace: #0 {main} thrown in /in/BLgHY on line 8
Process exited with code 255.
Output for hhvm-3.22.0
Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line -1 Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line -1 Fatal error: Uncaught TypeError: Argument 1 passed to date_diff() must implement interface DateTimeInterface, null given in /in/BLgHY:-1 Stack trace: #0 /in/BLgHY(-1): date_diff() #1 {main}
Process exited with code 255.
Output for hhvm-3.11.1 - 3.21.0
Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 3 Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 4 Fatal error: Uncaught TypeError: Argument 1 passed to date_diff() must implement interface DateTimeInterface, null given in /in/BLgHY:6 Stack trace: #0 /in/BLgHY(6): date_diff() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.1
Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 3 Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 4 Catchable fatal error: Argument 1 passed to date_diff() must implement interface DateTimeInterface, null given in /in/BLgHY on line 6
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 3 Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 4 Warning: date_diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/BLgHY on line 6 Fatal error: Call to a member function format() on boolean in /in/BLgHY on line 8
Process exited with code 255.
Output for 5.5.8 - 5.5.38
Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 3 Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 4 Warning: date_diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/BLgHY on line 6 Fatal error: Call to a member function format() on a non-object in /in/BLgHY on line 8
Process exited with code 255.
Output for 5.3.0 - 5.5.7
Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 3 Warning: DateTime::createFromFormat() expects at least 2 parameters, 1 given in /in/BLgHY on line 4 Warning: date_diff() expects parameter 1 to be DateTime, boolean given in /in/BLgHY on line 6 Fatal error: Call to a member function format() on a non-object in /in/BLgHY on line 8
Process exited with code 255.
Output for 5.2.10 - 5.2.17
Fatal error: Call to undefined method DateTime::createFromFormat() in /in/BLgHY on line 3
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Fatal error: Call to undefined method DateTime::createfromformat() in /in/BLgHY on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/BLgHY on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Undefined class name 'datetime' in /in/BLgHY on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Undefined class name 'datetime' in /in/BLgHY on line 3