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); $eventName = "$day $month $year ".$row5['name_event'] ; // this show me correct addDailyHtml( "Event: " . $eventName, "$day-$month-$year", null, $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/4GlKl on line 24 Fatal error: Uncaught Error: Cannot use string offset as an array in /in/4GlKl:37 Stack trace: #0 /in/4GlKl(20): addDailyHtml('Event: 12 10 20...', '12-10-2005', NULL, '') #1 {main} thrown in /in/4GlKl on line 37
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:
31.72 ms | 401 KiB | 8 Q