3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $startDate = '2014-01-01'; $endDate = '2014-12-31'; $startDateParts = explode('-', $startDate); $endDateParts = explode('-', $endDate); if (!checkdate($startDateParts[1], $startDateParts[0], $startDateParts[2]) || !checkdate($endDateParts[1], $endDateParts[0], $endDateParts[2])) { echo 'Invalid date ranges'; } else { echo 'GTG!'; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Invalid date ranges