Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85018 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51305 invoked from network); 16 Mar 2015 09:46:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Mar 2015 09:46:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=petercowburn@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=petercowburn@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.172 as permitted sender) X-PHP-List-Original-Sender: petercowburn@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:36888] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/A9-00492-A76A6055 for ; Mon, 16 Mar 2015 04:46:35 -0500 Received: by wixw10 with SMTP id w10so38086392wix.0 for ; Mon, 16 Mar 2015 02:46:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=iQ6xvJ/gPD9Ds5f7vs5H1jaQdz7LpJUG6AhwHL5znQ8=; b=tYJlXM0uJ+Q759S0dVo+tq4ZfD8qr/uMQKAH/M2u64GIe6IUeXqup+k4EC8Pef9K9X 5uPK/BmTvDWl9efl/zAB3I9gHJABHH9iQe0Ky8uqhfYK1i4aLd1YWBcmB7YDsFmkoBp0 RbPK2rWyxCDiGEsBj+TCPWDQbFlKxBabgmVd55KdPiwXapbHPb8wRjLSBriuutmNZmzv sv4HSS5GyPQQU659FEFm3a4t9KxdtUtRQPWfMZWhUTao43Muyx3EF6Yjq0GeHjjB9MtQ AsJChOtLYqg7+Eqfj42YT0VBaBSVQklq28R4Gq+4ZBvwwvXhe59E+OZUcvaxhXCtixUi Kthw== X-Received: by 10.180.74.170 with SMTP id u10mr44513309wiv.46.1426499191257; Mon, 16 Mar 2015 02:46:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.27.175.157 with HTTP; Mon, 16 Mar 2015 02:45:51 -0700 (PDT) In-Reply-To: <60525DAED8264509BF14D25637CD7C1E@gmail.com> References: <60525DAED8264509BF14D25637CD7C1E@gmail.com> Date: Mon, 16 Mar 2015 09:45:51 +0000 Message-ID: To: Wei Dai Cc: PHP Internals Content-Type: multipart/alternative; boundary=f46d043c7cec913fd8051164b91f Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Add preg_replace_callback_array function From: petercowburn@gmail.com (Peter Cowburn) --f46d043c7cec913fd8051164b91f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 16 March 2015 at 01:40, Wei Dai 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: `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 an= d its discussion thread (http://php.markmail.org/thread/qwiyq5o2vwlbdczq). > Any objections? > > > =E2=80=94 > Best, > Wei Dai > > --f46d043c7cec913fd8051164b91f--