Re: [PHP-DEV] New String Function: str_replace_limit

2012-07-16 Thread Gustavo Lopes
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. -- Gustavo Lopes -- PHP Internals - PHP

Re: [PHP-DEV] New String Function: str_replace_limit

2012-07-16 Thread Kingsquare.nl - Robin Speekenbrink
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

Re: [PHP-DEV] New String Function: str_replace_limit

2012-07-16 Thread 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

Re: [PHP-DEV] New String Function: str_replace_limit

2012-07-16 Thread Florian Anderiasch
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,

Re: [PHP-DEV] New String Function: str_replace_limit

2012-07-16 Thread Paul Dragoonis
On Mon, Jul 16, 2012 at 12:23 PM, Florian Anderiasch flor...@anderiasch.de 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

[PHP-DEV] New String Function: str_replace_limit

2012-07-15 Thread Paul Dragoonis
Hey, I'm proposing to add a new function str_replace_limit, this will be identical to str_replace() with one key difference, you can specify how many times you want the replace to occur. Currently this isn't possible with any functions in the /ext/standard/string.c stack, the only easy

Re: [PHP-DEV] New String Function: str_replace_limit

2012-07-15 Thread Felipe Pena
Hi, 2012/7/15 Paul Dragoonis dragoo...@gmail.com: Hey, I'm proposing to add a new function str_replace_limit, this will be identical to str_replace() with one key difference, you can specify how many times you want the replace to occur. Currently this isn't possible with any functions in

Re: [PHP-DEV] New String Function: str_replace_limit

2012-07-15 Thread Paul Dragoonis
The 4th param to str_replace is a by-ref param, so you can't just skip over it, can you ? On Sun, Jul 15, 2012 at 8:54 PM, Felipe Pena felipe...@gmail.com wrote: Hi, 2012/7/15 Paul Dragoonis dragoo...@gmail.com: Hey, I'm proposing to add a new function str_replace_limit, this will be