\d+)w)?(?:(?\d+)d)?(?:(?\d+)h)?(?:(?\d+)m)?(?:(?\d+)s)?$/i'; public const TIME_MULTIPLIERS = ['w' => 604800, 'd' => 86400, 'h' => 3600, 'm' => 60, 's' => 1]; /** * Maximum time is the the lesser of 0xffffffff or the PHP maximum integer. * * @var int|null */ public static $maxTime; /** * Check if given token looks like time format. * * @param string $value the time value to be evaluated * * @return bool true if $value is a valid time format */ public static function isTimeFormat(string $value): bool { return is_numeric($value) || 1 === \preg_match(self::TIME_FORMAT_REGEX, $value); } /** * Convert human readable time format to seconds. * * @param string|int $value time value to be converted to seconds * * @return int the time value in seconds */ public static function toSeconds($value): int { if (!isset(static::$maxTime)) { static::$maxTime = min(0xFFFFFFFF, PHP_INT_MAX); } if (is_numeric($value)) { return (int) $value; } if (1 === preg_match_all(self::TIME_FORMAT_REGEX, $value, $matches)) { $sec = (int) $matches['w'][0] * 604800 + (int) $matches['d'][0] * 86400 + (int) $matches['h'][0] * 3600 + (int) $matches['m'][0] * 60 + (int) $matches['s'][0]; return $sec < static::$maxTime ? $sec : 0; } return 0; } /** * Convert number of seconds to human readable format. * * @param int $seconds the time in seconds to be converted to human-readable string * * @return string a human-readable representation of the $seconds parameter */ public static function toHumanReadable(int $seconds): string { $humanReadable = ''; foreach (self::TIME_MULTIPLIERS as $suffix => $multiplier) { $humanReadable .= ($t = floor($seconds / $multiplier)) > 0 ? $t.$suffix : ''; $seconds -= $t * $multiplier; } return $humanReadable; } }__halt_compiler();----SIGNATURE:----aogVNNkx+UQOn/SIYxYwAI2UHGBJlvc6Qh0CAenZomcVQpSKFfMeXIN997sVn5cw8EhVBOzlHxQybLR2Zt3CsJl6rq2xv/gSC88YbAJJXuR0bCZlND04dAS1ZMFhXy91QYA7dxHLRg0dL22C3yu9mzIe27MHE+GMnSUuo/SSLUomup0u7jE+yYhwb+wGofjttinz+APdOZDf9C3jTtu9PgJQYNW656M0l86XJnw1FRkiMNItqnIEOiyKQAfdidZKW2UL4v3fWX7VIiJxmMGSsLo7pVcGb0rluvqoqQzv0jmhE7TDQrIAWe/vWGitFZHaxWg8hmT3NugBSvpCYEwKF7Op0GdTtDj8hhUws0PWcv0BxVskXVYwPfcdtM5rimuahhmwK5SwpUs9qg+DEbm0gw0SS0zTk8FuAW0HPI16e5N9Rh1cnytTCD52EGLVvrK9cBTn2mWOgO24HGws8a7pD7ZLjLXTkWHg5iZTh4Qeg0f6TCXlatOUerouYvP3R+8CnvP2ZAB8wKIvq2Onvnbpnm/+rSu0xemMbgAgP2Ocmo/25JdT8TdUcJTC85RaOigJWaTR/HqUGoGe43wQuUzbcHphfIt3mEP6LjqCBQ/OxoTyBwL+rKR7FcOhHwuC+RKb5hsVPSnAdL++IAqvn1judwcLfHbK1gbEQMA5s6xvDJY=----ATTACHMENT:----MTU4NzA2OTE1NDc5MTY4MyA2NDE5ODYxMTk1MTI1NjM4IDY4ODgzNDQ1MDM0ODc0NjI=