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

PHP Code:
   
   execute
() {
    
preg_replace_callback("/\?/",  array(&$this,'parse'), $statement);
    } 
I also tried
PHP Code:
  execute() {
    
preg_replace_callback("/\?/"" \$this->parse"$statement);
    } 
Didn't work, looked about a bit and found PHP5 related code.

So I then tried making the function static and
PHP Code:
   execute() {
     
preg_replace_callback("/\?/", array(__CLASS__'parse'), $statement);
     } 
still didn't work so I tried

PHP Code:
   execute() {
     
preg_replace_callback("/\?/", array(self,'parse'), $statement);
     } 
Still no luck.
Any suggestions
George