public static function shift(string &$str, string $encoding = null)
    {
        $encoding = $encoding ?: mb_internal_encoding();

        $first = mb_substr($str, 0, 1, $encoding);
        $str = mb_substr($str, 1, null, $encoding);

        return $first;
    }
public static function shift(string &$str, string $encoding = null)
    {
        $encoding = $encoding ?: mb_internal_encoding();

        $first = mb_substr($str, 0, 1, $encoding);
        $str = mb_substr($str, 1, null, $encoding);

        return $first;
    }
public static function shift ( string & $ str , string $ encoding = null ) { $ encoding = $ encoding ? : mb_internal_encoding ( ) ; $ first = mb_substr ( $ str , 0 , 1 , $ encoding ) ; $ str = mb_substr ( $ str , 1 , null , $ encoding ) ; return $ first ; }
Shift a character off the beginning of string

@param string $str
@param string $encoding

@return bool|string
Shift a character off the beginning of string