Gajus\Bugger\Bugger::translateTimestamp PHP Method

translateTimestamp() private static method

Match everything that looks like a timestamp and convert it to a human readable date-time format.
private static translateTimestamp ( string $output ) : string
$output string
return string
    private static function translateTimestamp($output)
    {
        $regex_encoding = mb_regex_encoding();
        $output = \mb_ereg_replace_callback('int[\\(| ]([0-9]{10})\\)?', function ($e) {
            if ($e[1] < mktime(0, 0, 0, 1, 1, 2000) || $e[1] > mktime(0, 0, 0, 1, 1, 2020)) {
                return $e[0];
            }
            return $e[0] . ' <== ' . date('Y-m-d H:i:s', $e[1]);
        }, $output);
        if ($output === false) {
            throw new Exception\ErrorException('PCRE error ocurred while attempting to replace timestamp values with human-friedly format.');
            # var_dump( array_flip(get_defined_constants(true)['pcre'])[preg_last_error()] );
        }
        mb_regex_encoding($regex_encoding);
        return $output;
    }