Re: New String Function: str_replace_limit

From: Date: Mon, 16 Jul 2012 11:23:43 +0000
Subject: Re: New String Function: str_replace_limit
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-61286@lists.php.net to get a copy of this message
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? :) Greetings, Florian

« previous php.internals (#61286) next »