public static function strrpos($str, $search)
    {
        if ($offset === false) {
            # Emulate behaviour of strrpos rather than raising warning
            if (empty($str)) {
                return false;
            }
            return mb_strrpos($str, $search);
        } else {
            if (! is_int($offset)) {
                trigger_error('utf8_strrpos expects parameter 3 to be long', E_USER_WARNING);
                return false;
            }

            $str = mb_substr($str, $offset);

            if (false !== ($pos = mb_strrpos($str, $search))) {
                return $pos + $offset;
            }

            return false;
        }
    }