\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:----mf/P4JR8x9BYiQnyntjr3lJjmO+nEo84sghU+jgUV6INkoPKkaBx9vgeOUPPC+8hK8oGBsVpmTxv4A47WnV+rPFrc9N1QRWAsGWJJe5ZJtAkMFoi2uhyuXkQfwHYtFS7Z2NrEmhVONcGM7xMXQEVvVzV+pf36Nl6wmllJjxzJKtU1ggXuUBzYwX+hum+/SUQX0ADr815hlhw0R5B7h6MHqhOCzG68+YINzCiLZuFBUJMFHjWH8DzuO3G34UbaOB8bv1zyTeEy+Bqiyc+tctBlLLpLTOE/mdHBLTmB/0sB9eEGYso/+TeSU03Cuymdwo84Su+wy7rMaPgPuNFljjVKmEi4/GVFUyDfYWykW/ifPPjAf5DMFtP9qVYHKH4sGVtXs0QZT+7r8fINNF4IWGcvbaPCux1Q8r+FFdOTiF1PCPlrPDtIFwY0Xsb3uWEGOFeAcoSasVQpaGc4bdR96isYi3uxE0bwQ3HM3M/p0W69y5Cx812y7JBXwConpiLFu2fmizUBzO8RSzrzcGMCJRnnjhw7mZ0gKTM+8Pafom9XeWMMGFSGgpiqj6g1vp56GWRqHCskGFXUJEZfXzLScLHxAA3cwWcE1lS+stSN479C9813IRVr+D/NPq8H2Mv+pin3qXZtEHX1DUWJYy0Z6B5FStb6vEyq25uA8WvITvm0UU=----ATTACHMENT:----NDEyNDEzMTgzOTk5NDg4OCA3NzgzNTY3MDI1OTM3NDI5IDQ0MDk0Mjk5MjE5MDk4NjA=