Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80324 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67559 invoked from network); 10 Jan 2015 16:01:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2015 16:01:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.214.174 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.214.174 mail-ob0-f174.google.com Received: from [209.85.214.174] ([209.85.214.174:54370] helo=mail-ob0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/12-48183-9CC41B45 for ; Sat, 10 Jan 2015 11:01:16 -0500 Received: by mail-ob0-f174.google.com with SMTP id uz6so17228721obc.5 for ; Sat, 10 Jan 2015 08:01:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=liGor6+D9jUHzRJDDoAPWIpUl1QK36gxKY4Ta8rzILY=; b=GlP/VdTBSsbjaXw2Q8ihRPXu1e9w24JYiSXs8bzjUyikE2HV90lqHslqTCalYAN/lB XQotGTVkPxS4pHflRBbAyaNHzdmU8wSdTnHWQwRA6WlFjP8rG6P0A+WxmVbV/hUaQGBp nxkTkVrk8bFPR79pWUCK3rCJlpa+VB4E26zQQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=liGor6+D9jUHzRJDDoAPWIpUl1QK36gxKY4Ta8rzILY=; b=W1HUs3avdrEtDV/2NQTdQj+fMQSyHnH35he68aM+6pMZrmwwN/2xh4krPQ3DAY6iPf ShCsmeVJbS8r/LnHS5/Ee9P8NMBTv93FdZilgZZCS3DDmMXgJ52q0q9CUJ2PFy7aCj12 v4cuVvAt9bSkGWbWvF5Nj1mhjq+sLRcAPYsE9+wvnEoB6LXALIf5B09yxuH8fNS6glIf najQlnoyl80vsX4/4UKKWnq9bleTrhZc9eCzXnK3UG9lspO7nsRUpkt43SJ1kdrMs5yl ZMeL3xfetemWtc/EzmVL4l/FqWxZMp6w3+BTEr2Wxbu407getFRdg+pMqDB1jmNFnkKQ Wfqg== X-Gm-Message-State: ALoCoQlz6YMBcmgkrKWNXTv7rBAGo9o4uqzQt2RPWlCSdDO18DxfVOO6kNl0AApasv1F7agUagfk MIME-Version: 1.0 X-Received: by 10.60.134.73 with SMTP id pi9mr12704301oeb.3.1420905671047; Sat, 10 Jan 2015 08:01:11 -0800 (PST) Received: by 10.202.214.146 with HTTP; Sat, 10 Jan 2015 08:01:10 -0800 (PST) In-Reply-To: References: <003e01d0290b$2387dd30$6a979790$@yahoo.fr> <007801d02ba0$659b9080$30d2b180$@tekwire.net> Date: Sat, 10 Jan 2015 18:01:10 +0200 Message-ID: To: Nikita Popov Cc: francois@tekwire.net, PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [BugFest] Feature request #38685: str_[i]replace(): Add support for (string needle, array replace) From: narf@devilix.net (Andrey Andreev) Hi, On Sat, Jan 10, 2015 at 1:53 PM, Nikita Popov wrote: > But if I see this (taken from the tests) as the search & replacement values... > > $search=array('[?]',array('(?)','d','e'),'a','R'); > $repl=array( > array('ap(?)z[?]',"b[?](?)v",null,37,"[?]n[?]"), > array('a',array('b',null)), > array('k(?)j[?]') > ); > > ... I have a pretty hard time figuring out what this is actually supposed > to do. At this point str_replace is working on arbitrarily-nested arrays > and also has four options to control its behavior. > > Imho this is just too much complexity for a relatively minor use case. I have to agree here. Nested arrays are too much ... it should be limited to single-dimention arrays. Cheers, Andrey.