3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tz = new DateTimeZone('America/Chicago'); // A timezone that has DST $five_hours_interval = new DateInterval('PT5H'); $date = new DateTime("2019-11-03 00:00:00", $tz); // goes backward at 2am echo $date->format('c') . "\n"; // Add five hours and subtract 5 hours. The $newDate should then equal the date. $five_hours_later = $date->add($five_hours_interval); $newDate = $five_hours_later->sub($five_hours_interval); echo $newDate->format('c');
Output for git.master, git.master_jit, rfc.property-hooks
2019-11-03T00:00:00-05:00 2019-11-03T00:00:00-05:00

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:
66.21 ms | 401 KiB | 8 Q