3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = 'Monday, September 28, 2009'; $time = strtotime($s); $start = strtotime('last sunday, 12pm', $time); $end = strtotime('next saturday, 11:59am', $time); $format = 'l, F j, Y g:i A'; $start_day = date($format, $start); $end_day = date($format, $end); header('Content-Type: text/plain'); echo "Input: $s\nOutput: $start_day - $end_day"; ?>
Output for 5.1.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Input: Monday, September 28, 2009 Output: Sunday, September 27, 2009 12:00 PM - Saturday, October 3, 2009 11:59 AM
Output for 4.3.0 - 5.0.5
Input: Monday, September 28, 2009 Output: Thursday, January 1, 1970 12:59 AM - Thursday, January 1, 1970 12:59 AM