3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zone=new DateTimeZone("America/Edmonton"); $o1=$zone->getOffset(new DateTime("2012-01-01",$zone))/3600; $o2=$zone->getOffset(new DateTime("2012-08-01",$zone))/3600; echo "2012-01-01: ".($o1==-7?"Pass":"Fail ($o1)")."\n"; echo "2012-08-01: ".($o2==-6?"Pass":"Fail ($o2)")."\n";
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.30, 8.0.0 - 8.0.22, 8.1.0 - 8.1.9
2012-01-01: Pass 2012-08-01: Pass

preferences:
49.74 ms | 409 KiB | 5 Q