3v4l.org

run code in 300+ PHP versions simultaneously
<?php $offset = 5; $offsetStr = "PT".$offset."H"; $date = new DateTime("18-July-2008 16:30:30"); date->sub($date, new DateInterval($offsetStr)); echo $date->format("d-m-Y H:i:s").' : 2 Hours'; echo $date->format("d-m-Y H:i:s").'<br />'; echo '<br />'.$date->format("d-m-Y").' : 5 Days'; date_sub($date, new DateInterval("P5Y5M5D")); echo '<br />'.$date->format("d-m-Y").' : 5 Days, 5 Months, 5 Years'; date_sub($date, new DateInterval("P5YT5H")); echo '<br />'.$date->format("d-m-Y H:i:s").' : 5 Years, 5 Hours'; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Undefined constant "date" in /in/YM3G1:7 Stack trace: #0 {main} thrown in /in/YM3G1 on line 7
Process exited with code 255.

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