3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function e($d) { echo $d->format("Y-m-d H:i:s O"), "\n"; } $irk = new DateTimeZone("Asia/Irkutsk"); $a = new DateTime("2010-10-30 01:30:00", $irk); e($a); $a->modify("+1 hour"); e($a); $a->modify("+1 hour"); e($a); $a->modify("+1 hour"); e($a);
based on MWlZm
Output for 5.2.0 - 7.2.0
2010-10-30 01:30:00 +0900 2010-10-30 02:30:00 +0900 2010-10-30 03:30:00 +0900 2010-10-30 04:30:00 +0900
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTimeZone' not found in /in/qZiRE on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimezone in /in/qZiRE on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimezone in /in/qZiRE on line 6