3v4l.org

run code in 300+ PHP versions simultaneously
<?php //A timestamp indicates a fixed point in time, irregardless of timezone and daylight savings, so PHP must not change it when setting it: $x = new DateTime(); $x->setTimezone(new DateTimezone('America/Chicago')); $x->setTimestamp(1446357600); echo $x->format('c') . "\n"; $x->setTimestamp(1446361200); echo $x->format('c') . "\n"; //This should have a different offset since it's outside DST echo $x->getTimestamp(); //Simpler example $x = new DateTime(); $x->setTimezone(new DateTimezone('America/Chicago')); $x->setTimestamp(1446361200); echo $x->getTimestamp(); //Returns a different timestamp. No apparent way to specify a timestamp during the repeated hour.
Output for git.master, git.master_jit, rfc.property-hooks
2015-11-01T01:00:00-05:00 2015-11-01T01:00:00-06:00 14463612001446361200

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
61.37 ms | 401 KiB | 8 Q