Re: [RFC][DISCUSSION] Add preg_replace_callback_array function
| From: | Peter Cowburn | Date: | Mon, 16 Mar 2015 09:45:51 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Add preg_replace_callback_array function | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-85018@lists.php.net to get a copy of this message | ||
On 16 March 2015 at 01:40, Wei Dai <zxcvdavid@gmail.com> wrote:
> Hi internals,
>
> The RFC to add a user-land function for an easy-to-use and reliable
> preg_replace_callback_array() in PHP is up for discussion:
> https://wiki.php.net/rfc/preg_replace_callback_array
>
> This proposes adding one function: š'¬5cìßòg
> hépreg_replace_callback_array() that
> is the better way to Implement when there are multiple patterns need to
> replace.
>
> I would love to hear your feedback! :)
>
Could you add a paragraph or two explaining the reasons for choosing this
particular proposal?
Some examples of what I would like to read:
- why we can't do preg_replace_callback($array_of_regexes,
$array_of_callbacks, $subject)
- why not preg_replace_callback($array_of_regex_to_callback_pairs,
$subject)
- why not pass the regex used to the callback, as per Laruence's earlier
RFC
And give a few links to historical discussions in the same sort of area?
E.g Laruence's RFC: https://wiki.php.net/rfc/second_arg_to_preg_callback
and
its discussion thread (http://php.markmail.org/thread/qwiyq5o2vwlbdczq).
> Any objections?
>
>
> —
> Best,
> Wei Dai
>
>