3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (date('w') == 2) { $last_tuesday = date('Y-m-d'); } else { $last_tuesday = date('Y-m-d', strtotime('last tuesday')); } echo $last_tuesday;
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
2012-10-23