3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $MNTTZ = new DateTimeZone('America/Denver'); $ESTTZ = new DateTimeZone('America/New_York'); $dt = new DateTime('11/24/2009 2:00 pm', $MNTTZ); var_dump($dt->format(DATE_RFC822), $dt->format('U')); $dt->setTimezone($ESTTZ); var_dump($dt->format(DATE_RFC822), $dt->format('U'));
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(29) "Tue, 24 Nov 09 14:00:00 -0700" string(10) "1259096400" string(29) "Tue, 24 Nov 09 16:00:00 -0500" string(10) "1259096400"
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTimeZone' not found in /in/CUZp9 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimezone in /in/CUZp9 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimezone in /in/CUZp9 on line 3