3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 7.1.0
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.
Output for 5.1.0 - 7.0.14
12 10 2005 test1<br/> Warning: Missing argument 4 for addDailyHtml(), called in /in/pEAC3 on line 21 and defined in /in/pEAC3 on line 25 12 10 2006 test2<br/> Warning: Missing argument 4 for addDailyHtml(), called in /in/pEAC3 on line 21 and defined in /in/pEAC3 on line 25 string(0) ""
Output for 5.0.0 - 5.0.5
12 10 2005 test1<br/> Warning: Missing argument 4 for addDailyHtml() in /in/pEAC3 on line 25 12 10 2006 test2<br/> Warning: Missing argument 4 for addDailyHtml() in /in/pEAC3 on line 25 string(0) ""
Output for 4.3.0 - 4.4.9
12 10 2005 test1<br/> Warning: Missing argument 4 for adddailyhtml() in /in/pEAC3 on line 25 12 10 2006 test2<br/> Warning: Missing argument 4 for adddailyhtml() in /in/pEAC3 on line 25 string(0) ""