Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61277 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46587 invoked from network); 16 Jul 2012 08:29:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2012 08:29:22 -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:46947] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/D7-20866-0E0D3005 for ; Mon, 16 Jul 2012 04:29:21 -0400 Received: by yenl12 with SMTP id l12so5593079yen.29 for ; Mon, 16 Jul 2012 01:29:18 -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=Wp3DtN7n+htrv3fl67nLhfE5f036ti5+ENk/pIVsMS8=; b=ebJcwjz/AY4bTiCtWnwooKbcHdksA2bgBtZkCBB80GZgiNz5/yAdlx5JrgBa3u4S96 vKee0Day5WxgYMG45MCxp2uPbOGbEpX5nw7qOKbl36oI/oMiSwuz9L2e9Jk97MHQ9nfS lENXu8Vh1bmkk1YoXon9oRuTdeQxxBdLRZJBzD0aeFErSdeGNWpzrKSzbKq4kvvDFaup oCPoxWGv5fdV8Co9bslk3EZKuJKwLM4qO5AssyKejhlHLB2H61zS2vZSSLzqmnidxaYO P3aPpfJo7vK1Mqpdk0cl+R6p5Qop74xeBqV761Esvlrl7EgVkZFvGxAVRphFs/r21WJc dlzg== MIME-Version: 1.0 Received: by 10.50.94.196 with SMTP id de4mr4601002igb.17.1342427357588; Mon, 16 Jul 2012 01:29:17 -0700 (PDT) Received: by 10.64.32.72 with HTTP; Mon, 16 Jul 2012 01:29:17 -0700 (PDT) In-Reply-To: <5003CC02.6070709@kingsquare.nl> References: <4672bc1ca5a1ad95956b60ea654f7b24@nebm.ist.utl.pt> <5003CC02.6070709@kingsquare.nl> Date: Mon, 16 Jul 2012 09:29:17 +0100 Message-ID: To: "Kingsquare.nl - Robin Speekenbrink" Cc: Gustavo Lopes , 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) 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) Thanks. Paul Dragoonis. On Mon, Jul 16, 2012 at 9:08 AM, Kingsquare.nl - Robin Speekenbrink wrote: > Hi all, > > I'm a strict follower of this list and havent posted (as of yet) due to the > fact that i'd like to be in the loop, but am not a C developer... :) > > But on this discussion i'd like to give my 2c: As a PHP developer i'd regret > to see yet another function added to the language instead of adding a new > parameter. (this it does the same thing just limited) Also with the other > discussion on being able to skip default parameters (using the keyword > 'default') this shouldnt be a problem should it? > > Thanks, i'll butt out now :D > > Op maandag 16 juli 2012 10:05:02, Gustavo Lopes schreef: > >> On Sun, 15 Jul 2012 20:59:10 +0100, Paul Dragoonis wrote: >>> >>> The 4th param to str_replace is a by-ref param, so you can't just skip >>> over it, can you ? >>> >> >> I don't think so, but we could make it so that you could by using >> optional passing by reference. >> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >