3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo date("Y-m-d", strtotime("2009-03-20 +5 weekday"))."\n"; //EXPECT: 2009-03-27. RETURNS: 2009-03-29 echo date("l", strtotime("friday +5 weekday"))."\n"; //EXPECT: "Friday". RETURNS: "Sunday" ## Works fine as long as start date is not a weekend... echo date("l", strtotime("thursday +6 weekday"))."\n"; //EXPECT: "Friday". RETURNS: "Friday" ## ...OR end date does not land on weekend: echo date("l", strtotime("friday +4 weekday"))."\n"; //EXPECT: "Thursday". RETURNS: "Thursday" ?>
Output for 5.5.0 - 7.1.0
2009-03-27 Friday Friday Thursday
Output for 5.2.0 - 5.4.45
2009-03-29 Sunday Friday Thursday
Output for 4.3.0 - 5.1.6
1970-01-01 Thursday Thursday Thursday