3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result5 = array( array('start_date' => '2005-10-12', 'name_event' => 'test1'), array('start_date' => '2006-10-12', 'name_event' => 'test2'), ); $daily_html = ''; foreach($result5 as $row5) { $time=strtotime($row5['start_date']); $day = date("d",$time); $month= date("m",$time); $month2= date("F",$time); $year=date("Y",$time); echo "$day $month $year ".$row5['name_event'] ; // this show me correct echo '<br/>'; addDailyHtml( "Event", "$day-$month-$year", $daily_html);// there is some problem } var_dump($daily_html); function addDailyHtml( $html, $start_date_string, $end_date_string = null, &$daily_html ) { static $htmlCount = 0; $start_date = strtotime($start_date_string); if( $end_date_string ) { $end_date = strtotime($end_date_string); } else { $end_date = $start_date; } $working_date = $start_date; do { $tDate = getdate($working_date); $working_date += 86400; $daily_html[$tDate['year']][$tDate['mon']][$tDate['mday']][$htmlCount] = $html; } while( $working_date < $end_date + 1 ); $htmlCount++; }
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Optional parameter $end_date_string declared before required parameter $daily_html is implicitly treated as a required parameter in /in/pEAC3 on line 25 12 10 2005 test1<br/> Fatal error: Uncaught ArgumentCountError: Too few arguments to function addDailyHtml(), 3 passed in /in/pEAC3 on line 21 and exactly 4 expected in /in/pEAC3:25 Stack trace: #0 /in/pEAC3(21): addDailyHtml('Event', '12-10-2005', '') #1 {main} thrown in /in/pEAC3 on line 25
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:
50.76 ms | 402 KiB | 8 Q