3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime('now'); var_dump($dt->getTimestamp()); $dt->setTimezone(new DateTimeZone(DateTimeZone::ASIA)); var_dump($dt->getTimestamp());
Output for 7.0.14 - 7.1.0
int(1409139802) Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (16) in /in/s5mRv:7 Stack trace: #0 /in/s5mRv(7): DateTimeZone->__construct('16') #1 {main} thrown in /in/s5mRv on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.8
int(1404829586) Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (16) in /in/s5mRv:7 Stack trace: #0 /in/s5mRv(7): DateTimeZone->__construct('16') #1 {main} thrown in /in/s5mRv on line 7
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
int(1404829586) Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone (16)' in /in/s5mRv:7 Stack trace: #0 /in/s5mRv(7): DateTimeZone->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.28
int(1409139802) Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone (16)' in /in/s5mRv:7 Stack trace: #0 /in/s5mRv(7): DateTimeZone->__construct('16') #1 {main} thrown in /in/s5mRv on line 7
Process exited with code 255.
Output for 5.3.0 - 5.6.23
int(1404829586) Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone (16)' in /in/s5mRv:7 Stack trace: #0 /in/s5mRv(7): DateTimeZone->__construct('16') #1 {main} thrown in /in/s5mRv on line 7
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::getTimestamp() in /in/s5mRv on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/s5mRv on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/s5mRv on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ')', expecting '(' in /in/s5mRv on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/s5mRv on line 7
Process exited with code 255.