Ok I have been struggling with this for the last hour. I have looked around a bit, and have found some 'answers' on the internals mailing list and a few other forums.
I am running PHP 5.0.4
I want to use preg_replace_callback within a class. I have 2 methods, execute(), which calles preg_replace_callback and parse() which is called back.
so I tried
I also triedPHP Code:
execute() {
preg_replace_callback("/\?/", array(&$this,'parse'), $statement);
}
Didn't work, looked about a bit and found PHP5 related code.PHP Code:execute() {
preg_replace_callback("/\?/", " \$this->parse", $statement);
}
So I then tried making the function static and
still didn't work so I triedPHP Code:execute() {
preg_replace_callback("/\?/", array(__CLASS__, 'parse'), $statement);
}
Still no luck.PHP Code:execute() {
preg_replace_callback("/\?/", array(self,'parse'), $statement);
}
Any suggestions
George





Bookmarks