private static function toBytes($phpSyntax)
    {
        $val = trim($phpSyntax);
        $last = strtolower($val[strlen($val) - 1]);
        if (!is_numeric($last)) {
            $val = substr($val, 0, -1);
            switch ($last) {
                case 'g':
                    $val *= 1024;
                case 'm':
                    $val *= 1024;
                case 'k':
                    $val *= 1024;
            }
        }
        return $val;
    }