3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkSlotRange($as,$ae,$bs,$be){ $as = strtotime($as); $ae = strtotime($ae); $bs = strtotime($bs); $be = strtotime($be); return ($as >= $bs && $ae <= $be); } var_dump(checkSlotRange("10:30", "11:30", "09:30", "12:30")); // true var_dump(checkSlotRange("10:30", "11:30", "11:20", "12:30")); // false

preferences:
148.61 ms | 405 KiB | 5 Q