3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dateTime = new DateTimeImmutable('now', new DateTimeZone('GMT+10:00')); var_dump($dateTime->format('c')); var_dump($dateTime->getTimestamp()); var_dump(time()); $dateTime = $dateTime->setTime(14, 0)->modify('- 10 days'); var_dump($dateTime->format('c')); var_dump($dateTime->getTimestamp());
based on goZgb
Output for 5.6.30, 7.0.30 - 7.3.0beta1
string(25) "2018-06-26T18:23:13+10:00" int(1530001393) int(1530001393) string(25) "2018-06-16T14:00:00+10:00" int(1529121600)
Output for hhvm-3.22.0
Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone (GMT+10:00)' in /in/90WsY:-1 Stack trace: #0 /in/90WsY(-1): DateTimeZone->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone (GMT+10:00)' in /in/90WsY:4 Stack trace: #0 /in/90WsY(4): DateTimeZone->__construct() #1 {main}
Process exited with code 255.