note 36662 deleted from function.preg-replace-callback by vincent
| From: | vincent@php.net | Date: | Sat, 18 Oct 2003 15:43:48 +0000 |
| Subject: | note 36662 deleted from function.preg-replace-callback by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58814@lists.php.net to get a copy of this message | ||
Note Submitter: manu@chasqui.cu
----
preg_replace_callback fails to work recursively.
I mean:
function replace1($match)
{
return 'This is recursively called';
}
function replace2($match)
{
... do something
return preg_replace_callback($anotherregexp, 'replace2', $astr);
}
...
echo preg_replace_callback($regexp, 'replace2', $str);
Will fail to produce the string. Although, both functions replace1 and replace2 are actually
called!!!
Is this documented anywhere, or is a bug?
Manu.