3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php for ($i = 1; $i <= 12; $i++) { $month = $i; $year = "2013"; echo "<br />"; $FirstFridayOfMonth = date('Y-m-d', strtotime("first Friday", strtotime(date('Y-m-d' , strtotime('-1 day' , strtotime ($year.'-'.$month.'-01')))))); echo "First friday of ".$month."-".$year." : ".$FirstFridayOfMonth; echo "<br />"; $LastThursdayOfMonth = date('Y-m-d', strtotime("last Thursday", strtotime(date('Y-m-d' , strtotime('+1 month' , strtotime ($year.'-'.$month.'-01')))))); echo "Last Thursday of ".$month."-".$year." : ".$LastThursdayOfMonth; echo "<br />"; $LastFridayOfMonth = date('Y-m-d', strtotime("last Friday", strtotime(date('Y-m-d' , strtotime('+1 month' , strtotime ($year.'-'.$month.'-01')))))); echo "Last Friday of ".$month."-".$year." : ".$LastFridayOfMonth; echo "<br />"; } ?>
Output for 5.1.0 - 7.1.0
<br />First friday of 1-2013 : 2013-01-04<br />Last Thursday of 1-2013 : 2013-01-31<br />Last Friday of 1-2013 : 2013-01-25<br /><br />First friday of 2-2013 : 2013-02-01<br />Last Thursday of 2-2013 : 2013-02-28<br />Last Friday of 2-2013 : 2013-02-22<br /><br />First friday of 3-2013 : 2013-03-01<br />Last Thursday of 3-2013 : 2013-03-28<br />Last Friday of 3-2013 : 2013-03-29<br /><br />First friday of 4-2013 : 2013-04-05<br />Last Thursday of 4-2013 : 2013-04-25<br />Last Friday of 4-2013 : 2013-04-26<br /><br />First friday of 5-2013 : 2013-05-03<br />Last Thursday of 5-2013 : 2013-05-30<br />Last Friday of 5-2013 : 2013-05-31<br /><br />First friday of 6-2013 : 2013-06-07<br />Last Thursday of 6-2013 : 2013-06-27<br />Last Friday of 6-2013 : 2013-06-28<br /><br />First friday of 7-2013 : 2013-07-05<br />Last Thursday of 7-2013 : 2013-07-25<br />Last Friday of 7-2013 : 2013-07-26<br /><br />First friday of 8-2013 : 2013-08-02<br />Last Thursday of 8-2013 : 2013-08-29<br />Last Friday of 8-2013 : 2013-08-30<br /><br />First friday of 9-2013 : 2013-09-06<br />Last Thursday of 9-2013 : 2013-09-26<br />Last Friday of 9-2013 : 2013-09-27<br /><br />First friday of 10-2013 : 2013-10-04<br />Last Thursday of 10-2013 : 2013-10-31<br />Last Friday of 10-2013 : 2013-10-25<br /><br />First friday of 11-2013 : 2013-11-01<br />Last Thursday of 11-2013 : 2013-11-28<br />Last Friday of 11-2013 : 2013-11-29<br /><br />First friday of 12-2013 : 2013-12-06<br />Last Thursday of 12-2013 : 2013-12-26<br />Last Friday of 12-2013 : 2013-12-27<br />
Output for 4.3.0 - 5.0.5
<br />First friday of 1-2013 : 2013-01-04<br />Last Thursday of 1-2013 : 2013-01-31<br />Last Friday of 1-2013 : 2013-01-25<br /><br />First friday of 2-2013 : 2013-02-01<br />Last Thursday of 2-2013 : 2013-02-28<br />Last Friday of 2-2013 : 2013-02-22<br /><br />First friday of 3-2013 : 2013-03-01<br />Last Thursday of 3-2013 : 2013-03-27<br />Last Friday of 3-2013 : 2013-03-28<br /><br />First friday of 4-2013 : 2013-04-05<br />Last Thursday of 4-2013 : 2013-04-25<br />Last Friday of 4-2013 : 2013-04-26<br /><br />First friday of 5-2013 : 2013-05-03<br />Last Thursday of 5-2013 : 2013-05-30<br />Last Friday of 5-2013 : 2013-05-31<br /><br />First friday of 6-2013 : 2013-05-31<br />Last Thursday of 6-2013 : 2013-06-27<br />Last Friday of 6-2013 : 2013-06-28<br /><br />First friday of 7-2013 : 2013-07-05<br />Last Thursday of 7-2013 : 2013-07-25<br />Last Friday of 7-2013 : 2013-07-26<br /><br />First friday of 8-2013 : 2013-08-02<br />Last Thursday of 8-2013 : 2013-08-29<br />Last Friday of 8-2013 : 2013-08-30<br /><br />First friday of 9-2013 : 2013-09-06<br />Last Thursday of 9-2013 : 2013-09-26<br />Last Friday of 9-2013 : 2013-09-27<br /><br />First friday of 10-2013 : 2013-10-04<br />Last Thursday of 10-2013 : 2013-10-31<br />Last Friday of 10-2013 : 2013-10-25<br /><br />First friday of 11-2013 : 2013-11-01<br />Last Thursday of 11-2013 : 2013-11-28<br />Last Friday of 11-2013 : 2013-11-29<br /><br />First friday of 12-2013 : 2013-12-06<br />Last Thursday of 12-2013 : 2013-12-26<br />Last Friday of 12-2013 : 2013-12-27<br />