note 13472 added to function.preg-replace-callback.php
| From: | franco at netwheel dot com | Date: | Mon, 18 Jun 2001 14:41:26 +0000 |
| Subject: | note 13472 added to function.preg-replace-callback.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14307@lists.php.net to get a copy of this message | ||
First, sorry for my elementary english.
On my box the
preg_replace_callback( "/(\w+)/", array( $this, callback_method ), $string)
seems to works properly but, after the execution the object seems to have lost the datas added
from the callback method.
Everyting works well if the $this parameter is passed to callback method as reference like
preg_replace_callback( "/(\w+)/", array( &$this, callback_method ), $string)
Also I noted that the compiler take the reference without any warning message regards
'Call-time pass-by-references deprecated'.
Ciao.
http://www.php.net/manual/en/function.preg-replace-callback.php