How do I call a function within the same class as a callback of preg_replace_callback?
<p>I have a function below:</p>

<pre><code> function make_clickable($ret) {

       $ret = ' ' . $ret;
        // in testing, using arrays here was found to be faster
            $save = @ini_set('pcre.recursion_limit', 10000);
            $retval = preg_replace_callback('#(?&lt;!=[\'"])(?&lt;=[*\')+.,;:!&amp;$\s&gt;])(\()?([\w]+?://(?:[\w\\x80-\\xff\#%~/?@\[\]-]{1,2000}|[\'*(+.,;:!=&amp;$](?![\b\)]|(\))?([\s]|$))|(?(1)\)(?![\s&lt;.,;:]|$)|\)))+)#is', '_make_url_clickable_cb', $ret);
            if (null !== $retval )
                    $ret = $retval;
        @ini_set('pcre.recursion_limit', $save);
        $ret = preg_replace_callback('#([\s&gt;])((www|ftp)\.[\w\\x80-\\xff\#$%&amp;~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret);
            $ret = preg_replace_callback('#([\s&gt;])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret);
            // this one is not in an array because we need it to run last, for cleanup of accidental links within links
        $ret = preg_replace("#(&lt;a( [^&gt;]+?&gt;|&gt;))&lt;a [^&gt;]+?&gt;([^&gt;]+?)&lt;/a&gt;&lt;/a&gt;#i", "$1$3&lt;/a&gt;", $ret);
        $ret = trim($ret);
            return $ret;
    }
</code></pre>

<p>And three callbacks which the function above calls to return the formatted string using preg_replace_callback.</p>

<pre><code>function _make_url_clickable_cb($matches) {
                $url = $matches[2];
                $suffix = '';

                /** Include parentheses in the URL only if paired **/
                while ( substr_count( $url, '(' ) &lt; substr_count( $url, ')' ) ) {
                        $suffix = strrchr( $url, ')' ) . $suffix;
                        $url = substr( $url, 0, strrpos( $url, ')' ) );
                }

            $url = esc_url($url);
            if ( empty($url) )
                    return $matches[0];

                $test = parse_url($url);
                if ($test['host'] == 'www.flickr.com' || $test['host'] == 'www.youtube.com') {
                 return $matches[1] . "&lt;a href=\"$url\" rel=\"nofollow\" class='oembed' target='_blank'&gt;$url&lt;/a&gt;" . $suffix;
                }
                else {
                 return $matches[1] . "&lt;a href=\"$url\" rel=\"nofollow\" target='_blank'&gt;$url&lt;/a&gt;" . $suffix;
                }


        }



function _make_web_ftp_clickable_cb($matches) {
                                    $ret = '';
                                    $dest = $matches[2];
                                    $dest = 'http://' . $dest;
                                    $dest = esc_url($dest);
                                    if ( empty($dest) )
                                        return $matches[0];

                                    // removed trailing [.,;:)] from URL
                                    if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
                                        $ret = substr($dest, -1);
                                        $dest = substr($dest, 0, strlen($dest)-1);
                                    }
                                    $test = parse_url($dest);
                                        if ($test['host'] == 'www.flickr.com' || $test['host'] == 'www.youtube.com') {
                                            return $matches[1] . "&lt;a href=\"$dest\" rel=\"nofollow\" class='oembed' target='_blank'&gt;$dest&lt;/a&gt;" . $suffix;
                                        }
                                        else {
                                            return $matches[1] . "&lt;a href=\"$dest\" rel=\"nofollow\" target='_blank'&gt;$dest&lt;/a&gt;" . $suffix;
                                        }
                }

function _make_email_clickable_cb($matches) {
                $email = $matches[2] . '@' . $matches[3];
                return $matches[1] . "&lt;a href=\"mailto:$email\"&gt;$email&lt;/a&gt;";
        }
</code></pre>

<p>This all works perfectly.  However, when this is put inside a class with the main function (make_clickable) set as a public function and the three callbacks set to private.  It does not work.</p>

<p>How would I go about calling suning the callbacks I have specificed for preg_replace_callback, within a class?</p>
