3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $startDate = '2014-01-01'; $endDate = '2014-12-31'; $pattern = '/^(\d{4})-(\d{2})-(\d{2})$/'; if (!preg_match($pattern, $startDate) || !preg_match($pattern, $endDate)) { echo 'Invalid date ranges'; } else { echo 'GTG!'; }
Output for 4.3.0 - 7.1.0
GTG!