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

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

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

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

        return $last;
    }
public static function pop ( string & $ str , string $ encoding = null ) { $ encoding = $ encoding ? : mb_internal_encoding ( ) ; $ last = mb_substr ( $ str , - 1 , null , $ encoding ) ; $ str = mb_substr ( $ str , 0 , - 1 , $ encoding ) ; return $ last ; }
Pop the character off the end of string

@param string $str
@param string $encoding

@return bool|string
Pop the character off the end of string