protected function returnBytes($val)
    {
        $val = trim($val);
        $last = strtolower($val[strlen($val)-1]);
        // Do not add breaks in the switch below
        switch ($last) {
            // The 'G' modifier is available since PHP 5.1.0
            case 'g':
                $val = (int)$val*1024;
                // no break
            case 'm':
                $val = (int)$val*1024;
                // no break
            case 'k':
                $val = (int)$val*1024;
        }

        return $val;
    }