3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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="en">Moday&#13;".$i".".$month.".".$year."</span><span class="bg">Понеделнк&#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++; } } ?>
based on kfkj0
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Parse error: syntax error, unexpected 'en' (T_STRING), expecting ',' or ';' in /in/rGnJs on line 39
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_STRING, expecting ',' or ';' in /in/rGnJs:39 Stack trace: #0 {main}
Process exited with code 255.