getTimestamp(); } else { // try to check strtotime $timeFromString = strtotime($timeInput); if ($timeFromString) { $timeLimit = $timeFromString; } else { throw new Exception('Time limit Low could not be resolved to an integer. Given was: ' . htmlspecialchars($timeLimit)); } } } return $timeLimit; } /** * @param string|int $timeInput * @return int * @throws Exception */ public static function getTimeRestrictionHigh($timeInput): int { $timeLimit = 0; // integer = timestamp if (MathUtility::canBeInterpretedAsInteger($timeInput)) { $timeLimit = $GLOBALS['SIM_EXEC_TIME'] + $timeInput; return $timeLimit; } // try to check strtotime $timeFromStringHigh = strtotime($timeInput); if ($timeFromStringHigh) { $timeLimit = $timeFromStringHigh; return $timeLimit; } throw new Exception('Time limit High could not be resolved to an integer. Given was: ' . htmlspecialchars($timeLimit)); } }