Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61287 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70113 invoked from network); 16 Jul 2012 11:30:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2012 11:30:44 -0000 Authentication-Results: pb1.pair.com header.from=dragoonis@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dragoonis@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: dragoonis@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:60383] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/31-63072-26BF3005 for ; Mon, 16 Jul 2012 07:30:43 -0400 Received: by yenl12 with SMTP id l12so5709156yen.29 for ; Mon, 16 Jul 2012 04:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xVjxefE1JPxipzj2aFItDlD/6ppZvsvLwDGuyeuAfqk=; b=hClIarS8omkztjexFiSCQ24iYbWi1aM/axPiohbCr/AWx+OkN3Fi9TO9WpS+ZmYnLT EgMxb2KcBU5CWL6asuVEr/0KCs5oRXf+EhqOuZahqj+IrUY7mh0AfbtUTta3SHsC31RT /gAXLcOl3bbIllIyNkGP4cyXmXCaBiKbzaraXGHpmGChmk/MeycsOLnWmAApcBxbAeBt QO/de8Rdi3cSl/8S6uQu/Kkl2mp29qdO0Pt8JvEjklBjbuXpy7U/NDEz/NKydsogOFMc mzfryHyQlf4MAjpExRhnNUxQtePED0BTYo8Px+HItg+AhWcz5fr7veRE6/w+PrQDMT1S Tuyw== MIME-Version: 1.0 Received: by 10.50.94.196 with SMTP id de4mr4865763igb.17.1342438239951; Mon, 16 Jul 2012 04:30:39 -0700 (PDT) Received: by 10.64.32.72 with HTTP; Mon, 16 Jul 2012 04:30:39 -0700 (PDT) In-Reply-To: <5003F9BF.4010209@anderiasch.de> References: <4672bc1ca5a1ad95956b60ea654f7b24@nebm.ist.utl.pt> <5003CC02.6070709@kingsquare.nl> <5003F9BF.4010209@anderiasch.de> Date: Mon, 16 Jul 2012 12:30:39 +0100 Message-ID: To: Florian Anderiasch Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] New String Function: str_replace_limit From: dragoonis@gmail.com (Paul Dragoonis) On Mon, Jul 16, 2012 at 12:23 PM, Florian Anderiasch wrote: > On 07/16/2012 10:29 AM, Paul Dragoonis wrote: >> Thanks for the comments guys, I like your idea about skipping the >> by-ref count parameter. >> >> If the 'default' keyword were to be added in, then you could skip the >> 4th parameter and add your 5th 'limit' option. >> >> $str = str_replace($search, $replace, $subject, default, 5); >> >> Does anyone have any objections on this implementation approach? >> (obviously we'd have to wait for the default param skipping to be >> implemented, I'm not sure on the implementation status of that >> feature) > > I'm not seeing what's the problem with it being a by-ref variable, as > you've mentioned it twice now. Are you bothered by an additional > variable being set in memory when skipping (i.e. not using it)? Or am I > reading more into it than you tried to say? :) I believe you were reading more into it. I mention by-ref so it's easy to know if i'm talking about the existing or new proposed param. I'm not bothered by the by-ref param being skipped over to get to the 5th one, it's a hit I'm willing to take to achieve necessary functionality on str_replace(). If nobody has any further concerns I'll go ahead and create this new parameter and provide a PR on github accordingly. Paul Dragoonis. > > Greetings, > Florian