3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sStart = '2013-13-05T21:56:00'; $sEnd = '2013-15-05T21:56:01'; $sStartDate = new DateTime($sStart); $sEndDate = new DateTime($sEnd); $diff = date_diff($sStartDate, $sEndDate, true); $days = $diff->format('%a'); echo $days; if (1 <= $days) { echo '24 hours or more.'; } else { echo 'less than 24 hours.'; }
Output for git.master, git.master_jit
Fatal error: Uncaught Exception: Failed to parse time string (2013-13-05T21:56:00) at position 6 (3): Unexpected character in /in/ASYgl:6 Stack trace: #0 /in/ASYgl(6): DateTime->__construct('2013-13-05T21:5...') #1 {main} thrown in /in/ASYgl on line 6
Process exited with code 255.
Output for rfc.property-hooks
Fatal error: Uncaught DateMalformedStringException: Failed to parse time string (2013-13-05T21:56:00) at position 6 (3): Unexpected character in /in/ASYgl:6 Stack trace: #0 /in/ASYgl(6): DateTime->__construct('2013-13-05T21:5...') #1 {main} thrown in /in/ASYgl 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:
95.85 ms | 401 KiB | 8 Q