3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = strtotime('2014-01-01') - strtotime('2014-01-01'); var_dump('2014-01-01'); var_dump($x); echo '<br/>'; date_default_timezone_set('Europe/London'); $date = new DateTime(); $A = $date->format('Y-m-d H:i:s'); echo '<br />'; $date->modify("+64 minutes"); $B = $date->format('Y-m-d H:i:s'); echo '<br />'; echo date('h:i', strtotime($B) - strtotime($A));
Output for 5.2.0 - 7.1.0
string(10) "2014-01-01" int(0) <br/><br /><br />02:04
Output for 5.1.0 - 5.1.6
string(10) "2014-01-01" int(0) <br/> Fatal error: Class 'DateTime' not found in /in/4v238 on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5
string(10) "2014-01-01" int(0) <br/> Fatal error: Call to undefined function date_default_timezone_set() in /in/4v238 on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
string(10) "2014-01-01" int(0) <br/> Fatal error: Call to undefined function: date_default_timezone_set() in /in/4v238 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
string(10) "2014-01-01" int(0) <br/> Fatal error: Call to undefined function: date_default_timezone_set() in /in/4v238 on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
string(10) "2014-01-01" int(0) <br/> Fatal error: Call to undefined function: date_default_timezone_set() in /in/4v238 on line 6