3v4l.org

run code in 200+ 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)) { return 'Invalid date ranges'; }
Output for 4.3.0 - 7.2.0