3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('Zulu'); $interval = date_diff( new DateTime("10/12/2013 16:00"), new DateTime("10/13/2014 16:00") ); $time_interval = new DateInterval("P1W"); $a = $interval >= $time_interval; $b = $interval == $time_interval; $c = $interval <= $time_interval; echo $interval->format('D M'); $d = $interval >= $time_interval; $e = $interval == $time_interval; $f = $interval <= $time_interval; var_dump($a, $b, $c, $d, $e, $f);
based on Ik331
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
D Mbool(true) bool(true) bool(true) bool(true) bool(true) bool(true)
Output for 5.1.0 - 5.2.17
Fatal error: Call to undefined function date_diff() in /in/qkMUO on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/qkMUO on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/qkMUO on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/qkMUO on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/qkMUO on line 3