3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $timezone = new DateTimeZone( 'UTC' ); $datetime = new DateTime(); $datetime->setTimezone( $timezone ); $datetime->setTimestamp( strtotime( '2013-02-13 13:59:27' ) ); echo $datetime->format( 'Y-m-d H:i:s' ); //2013-02-13 12:59:27
Output for 5.3.0 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.1.0
2013-02-13 12:59:27
Output for hhvm-3.12.0

Process exited with code 137.
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::setTimestamp() in /in/Nm0Ua on line 6
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.1.6
Fatal error: Class 'DateTimeZone' not found in /in/Nm0Ua on line 3
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/Nm0Ua on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimezone in /in/Nm0Ua 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/Nm0Ua on line 3