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="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++; } } ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.1.70.0090.00716.76
7.1.60.0220.01435.11
7.1.50.0250.01034.48
7.1.40.0390.01634.33
7.1.30.0220.01234.25
7.1.20.0210.01434.43
7.1.10.0090.00616.50
7.1.00.0030.01416.34
7.0.200.0090.00616.48
7.0.190.0000.01616.51
7.0.180.0100.01016.00
7.0.170.0000.01416.12
7.0.160.0160.00316.11
7.0.150.0160.01615.84
7.0.140.0090.01016.01
7.0.130.0030.01516.30
7.0.120.0090.00916.36
7.0.110.0080.01216.25
7.0.100.0100.00715.88
7.0.90.0030.01216.11
7.0.80.0120.00916.23
7.0.70.0090.00916.15
7.0.60.0050.01215.98
7.0.50.0060.01216.10
7.0.40.0090.00916.21
7.0.30.0030.01416.39
7.0.20.0070.01016.30
7.0.10.0120.00316.13
7.0.00.0030.01516.31

preferences:
135.71 ms | 1394 KiB | 7 Q