3v4l.org

run code in 300+ PHP versions simultaneously
<?php function days_in_month($month, $year) { return date('t', mktime(0, 0, 0, $month, 1, $year)); } $months = array(5,6,7); $year = "2017"; foreach($months as $month) { $days_in_month = days_in_month($month, $year); $first_day = mktime(0,0,0,$month, 1, $year) ; $day_of_week = date('D', $first_day); $month = str_pad($month, 2, 0, STR_PAD_LEFT); //--------------------------------------------------------- //sets the first day of the month to 1 $day_num = 1; //count up the days, until you've done all of them in the month while ( $day_num <= $days_in_month ) { $i = str_pad($day_num, 2, 0, STR_PAD_LEFT); $day = date('D', mktime(0,0,0,$month, $day_num, $year)); if (date('d.m', mktime(0, 0, 0, $month, $i, $year)) == date('d.m')){ echo "<a href='".site_url()."/?date=".$i.".".$month."' class='today' title='Днес'><span>".$i."</span><br/>/</a>"; } elseif ($i.".".$month == $_GET['date']){ echo "<a href='".site_url()."/?date=".$i.".".$month."' class='selected' title='Събития на&#13; $i".".$month".".$year'><span>".$i."</span><br/>/</a>"; } elseif ($day == 'Mon'){ echo "<a href='".site_url()."/?date=".$i.".".$month."' class='monday' title=<span class="bg">Понеделни"к&#13; $i".".$month".".$year"</span><span class="en">Mondey"&#13; $i".".$month".".$year"</span>><span>".$i."</span><br/>/</a>"; } else { switch ($day) { case "Tue": echo "<a href='".site_url()."/?date=".$i.".".$month."' class='workday' title='Вторник&#13; $i".".$month".".$year'><span>".$i."</span><br/>/</a>"; break; case "Wed": echo "<a href='".site_url()."/?date=".$i.".".$month."' class='workday' title='Сряда&#13; $i".".$month".".$year'><span>".$i."</span><br/>/</a>"; break; case "Thu": echo "<a href='".site_url()."/?date=".$i.".".$month."' class='workday' title='Четвъртък&#13; $i".".$month".".$year'><span>".$i."</span><br/>/</a>"; break; case "Fri": echo "<a href='".site_url()."/?date=".$i.".".$month."' class='workday' title='Петък&#13; $i".".$month".".$year'><span>".$i."</span><br/>/</a>"; break; case "Sat": echo "<a href='".site_url()."/?date=".$i.".".$month."' class='workday' title='Събота&#13; $i".".$month".".$year'><span>".$i."</span><br/>/</a>"; break; case "Sun": echo "<a href='".site_url()."/?date=".$i.".".$month."' class='workday' title='Неделя&#13; $i".".$month".".$year'><span>".$i."</span><br/>/</a>"; // break; // default: // echo "Your favorite color is neither red, blue, nor green!"; } //echo "<a href='".site_url()."/?date=".$i.".".$month."' class='workday' title=$i".".$month".".$year><span>".$i."</span><br/>/</a>"; } $day_num++; } } ?>
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.21, 7.2.0 - 7.2.9
Parse error: syntax error, unexpected 'bg' (T_STRING), expecting ',' or ';' in /in/9q0Pt on line 39
Process exited with code 255.

preferences:
200.43 ms | 1395 KiB | 71 Q