3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTime( "7 days ago"); $yourInterval= new DateInterval( 'P1D'); $yorPeriodOfSevenDays= new DatePeriod( $now, $interval, 7); foreach($yorPeriodOfSevenDays as $day) { $date = $day->format( 'd-m-Y'); $resultArray[] = $date ; }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $interval in /in/fKYI7 on line 5 Fatal error: Uncaught TypeError: DatePeriod::__construct() accepts (DateTimeInterface, DateInterval, int [, int]), or (DateTimeInterface, DateInterval, DateTime [, int]), or (string [, int]) as arguments in /in/fKYI7:5 Stack trace: #0 /in/fKYI7(5): DatePeriod->__construct(Object(DateTime), NULL, 7) #1 {main} thrown in /in/fKYI7 on line 5
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:
41.24 ms | 401 KiB | 8 Q