Le 29/04/2013 18:46, Laruence a écrit : > so I propose to add a second argument to callback(aim to php-5.5.1),
Seems a useful fix to this problem (also encounter elsewhere) > what do you think(of course, the second argument can also easily change > to be the regex idx in the regex array)? I will prefer the idx (regex can be really long and complex string, and a minor change to a regex need to be also applied in the callback) Esp if you can use a more simpler / meaningful value Ex: $code = preg_replace_callback( array( "foo" => "/some very complex regex/", "bar" => "/another one/", ... ), function($matches, $idx) { switch ($idx) { case 'foo' ... case 'bar': ... } }, $code); My 0,02€ Remi. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php