3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $format = 'd/m/Y'; foreach (range(1, 7) as $number) { $difference = strtotime('+' . $number . ' days'); $day = strtolower(date('l', $difference)); var_dump($day); $$day = $difference; } $todayName = date('l'); $$todayName = date($format); var_dump($monday); var_dump($tuesday); var_dump($wednesday); var_dump($thursday); var_dump($friday); var_dump($saturday); var_dump($sunday);
Output for 4.3.0 - 4.4.9, 5.0.3 - 7.2.0
string(8) "saturday" string(6) "sunday" string(6) "monday" string(7) "tuesday" string(9) "wednesday" string(8) "thursday" string(6) "friday" int(1431355009) int(1431441409) int(1431527809) int(1431614209) int(1431700609) int(1431182209) int(1431268609)
Output for 5.0.0 - 5.0.2
string(8) "saturday" string(6) "sunday" string(6) "monday" string(7) "tuesday" string(9) "wednesday" string(8) "thursday" string(6) "friday" int(1431295200) int(1431381600) int(1431468000) int(1431554400) int(1431640800) int(1431122400) int(1431208800)