public static function camelCaseToUnderscore($str)
    {
        $under = "";
        $chars = self::chars($str);
        $lower = false;
        $upper = false;
        foreach($chars as $char) {
            if ("_" !== $char && "-" !== $char) {
                if (self::startsUpper($char)) {
                    $under .= ($lower || $upper) ? "_{$char}" : $char;
                    $lower  = false;
                    $upper  = true;
                } else {
                    $under .= $char;
                    $lower  = true;
                    $upper  = false;
                }
            }
        }
        
        return self::toLower($under);
    }