3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function isDST(\DateTime $date){ return $date->getTimezone()->getTransitions($date->getTimestamp(), $date->getTimestamp())[0]['isdst']; } $date = new \DateTime('2014-03-08', new \DateTimeZone('America/New_York')); var_dump(isDST($date)); $date = new \DateTime('2014-03-10', new \DateTimeZone('America/New_York')); var_dump(isDST($date)); $date = new \DateTime()); var_dump(isDST($date));
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected ')' in /in/c6riA on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '[' in /in/c6riA on line 3
Process exited with code 255.