3v4l.org

run code in 300+ PHP versions simultaneously
<?php $begin = new DateTime( '2015-01-01' ); $end = new DateTime( '2017-12-26' ); $interval = new DateInterval('P6M'); $period = new DatePeriod($begin, $interval, $end); foreach ( $period as $dt ) $endDate = (new $dt)->add($interval)->sub(new DateInterval('PT1D')); echo sprintf("%s-%s\n", $dt->format("Y-m-d"), $endDate->format("Y-m-d"));
Output for git.master, git.master_jit
Fatal error: Uncaught Exception: Unknown or bad format (PT1D) in /in/k9vpk:11 Stack trace: #0 /in/k9vpk(11): DateInterval->__construct('PT1D') #1 {main} thrown in /in/k9vpk on line 11
Process exited with code 255.
Output for rfc.property-hooks
Fatal error: Uncaught DateMalformedIntervalStringException: Unknown or bad format (PT1D) in /in/k9vpk:11 Stack trace: #0 /in/k9vpk(11): DateInterval->__construct('PT1D') #1 {main} thrown in /in/k9vpk on line 11
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:
57.08 ms | 401 KiB | 8 Q