3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $day_now = date("l"); if($day_now != "Monday"){ $date_beg = date("Y-m-d",strtotime("last Monday")); }else{ $date_beg = date("Y-m-d"); } $ts = $date_beg; $unJour = 3600 * 24; // nombre de secondes dans une journée $ts += 4*$unJour; // 4 jours de plus $date_end = date("Y-m-d",$ts); echo $date_end;
based on YDorB
Output for 7.1.0 - 7.2.0
Notice: A non well formed numeric value encountered in /in/oB9FW on line 10 1970-01-05
Output for 5.5.0 - 7.0.20
1970-01-05