function func($arg1, $arg2 = null) {}
$refFunc = new ReflectionFunction('func');
print $refFunc->getNumberOfParameters(); // 2
print $refFunc->getNumberOfRequiredParameters(); // 1
const intervals = [
{ start: '11:00:00', end: '13:00:00' },
{ start: '15:00:00', end: '17:00:00' }
]
const findIntersection = (intervals, start, end) =>
intervals.find(
interval => start < interval.end && interval.start < end
)
findIntersection(intervals, '09:00:00', '11:00:00')
// undefined
findIntersection(intervals, '09:00:00', '12:00:00')
// Object { start: "11:00:00", end: "13:00:00" }