public static function camelCaseToSeparator($text, $sep = " ")
    {
        if (!is_scalar($text) && !is_array($text)) {
            return $text;
        }
        if (self::hasPcreUnicodeSupport()) {
            $pattern = array(
                '#(?<=(?:\p{Lu}))(\p{Lu}\p{Ll})#',
                '#(?<=(?:\p{Ll}|\p{Nd}))(\p{Lu})#'
            );
            $replacement = array($sep.'\1', $sep.'\1');
        } else {
            $pattern = array(
                '#(?<=(?:[A-Z]))([A-Z]+)([A-Z][a-z])#',
                '#(?<=(?:[a-z0-9]))([A-Z])#');
            $replacement = array('\1'.$sep.'\2', $sep.'\1');
        }
        return preg_replace($pattern, $replacement, $text);
    }