3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime("18-July-2008 16:30:30"); echo $date->format("d-m-Y H:i:s").'<br />'; date_sub($date, new DateInterval("P2H")); echo '<br />'.$date->format("d-m-Y").' : 2 Hours'; 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
18-07-2008 16:30:30<br /> Fatal error: Uncaught Exception: Unknown or bad format (P2H) in /in/HcvNt:6 Stack trace: #0 /in/HcvNt(6): DateInterval->__construct('P2H') #1 {main} thrown in /in/HcvNt on line 6
Process exited with code 255.
Output for rfc.property-hooks
18-07-2008 16:30:30<br /> Fatal error: Uncaught DateMalformedIntervalStringException: Unknown or bad format (P2H) in /in/HcvNt:6 Stack trace: #0 /in/HcvNt(6): DateInterval->__construct('P2H') #1 {main} thrown in /in/HcvNt on line 6
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:
59.37 ms | 401 KiB | 8 Q