Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-22 Thread Jordi Boggiano
On Wed, Jun 22, 2011 at 3:30 AM, Sanford Whiteman wrote: >> Right now strtr('anything', 'anything', '') === 'anything', which >> means that anyone relying on this behavior is doing something strange >> and dumb imo, doing a function call for nothing. > > How  is relying on by-design behavior that

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-21 Thread Sanford Whiteman
> Right now strtr('anything', 'anything', '') === 'anything', which > means that anyone relying on this behavior is doing something strange > and dumb imo, doing a function call for nothing. How is relying on by-design behavior that turns the call into a no-op (instead of wrapping the call in a

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-21 Thread Jordi Boggiano
On Wed, Jun 22, 2011 at 2:22 AM, Stas Malyshev wrote: >> Right now strtr('anything', 'anything', '') === 'anything', which >> means that anyone relying on this behavior is doing something strange >> and dumb imo, doing a function call for nothing. We could maybe say > > It does not matter if you a

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-21 Thread Stas Malyshev
Hi! On 6/21/11 5:14 PM, Jordi Boggiano wrote: Right now strtr('anything', 'anything', '') === 'anything', which means that anyone relying on this behavior is doing something strange and dumb imo, doing a function call for nothing. We could maybe say It does not matter if you approve or disappr

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-21 Thread Jordi Boggiano
On Tue, Jun 21, 2011 at 12:55 PM, Derick Rethans wrote: > On Mon, 20 Jun 2011, Stas Malyshev wrote: > >> > Here is the next one. >> > >> > I think it's quite intuitive to use strtr() to remove single characters of >> > a >> > string, too, instead of using many str_replace($str, $chr, ""). I'd gla

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-21 Thread Derick Rethans
On Mon, 20 Jun 2011, Stas Malyshev wrote: > > Here is the next one. > > > > I think it's quite intuitive to use strtr() to remove single characters of a > > string, too, instead of using many str_replace($str, $chr, ""). I'd glad to > > see this change also in 5.4. > > This is a BC break, if I u

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Stas Malyshev
Hi! On 6/20/11 10:56 AM, Robert Eisele wrote: Stas, Why should it be a BC break? Empty strings are not considered, in any mode or what feature of strtr() did I miss? Because now strtr("passion", "os", "") returns different result. Combined with the fact that you already can do it with array sy

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Robert Eisele
Stas, Why should it be a BC break? Empty strings are not considered, in any mode or what feature of strtr() did I miss? Gustavo, does you not constradict yourself, when you say it's already available in the one mode and in the other it shouldn't be? What about the intuitive and nosy developers tha

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Gustavo Lopes
Em Mon, 20 Jun 2011 12:32:30 +0100, Robert Eisele escreveu: $demise = strtr("passion", "os", ""); This is a very bad idea for several reasons: - strtr already does this with: $demise = strtr("passion", array("o" => "", "s" => "")); - it's a BC break - adds a *third* operation mode to st

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Stas Malyshev
Hi! Here is the next one. I think it's quite intuitive to use strtr() to remove single characters of a string, too, instead of using many str_replace($str, $chr, ""). I'd glad to see this change also in 5.4. This is a BC break, if I understand it correctly, so I don't think it is a good idea

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Robert Eisele
2011/6/20 Derick Rethans > On Mon, 20 Jun 2011, Robert Eisele wrote: > > > Here is the next one. > > > > I think it's quite intuitive to use strtr() to remove single characters > of a > > string, too, instead of using many str_replace($str, $chr, ""). I'd glad > to > > see this change also in 5.4

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Derick Rethans
On Mon, 20 Jun 2011, Robert Eisele wrote: > Here is the next one. > > I think it's quite intuitive to use strtr() to remove single characters of a > string, too, instead of using many str_replace($str, $chr, ""). I'd glad to > see this change also in 5.4. Do you mean that (the currently document

[PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Robert Eisele
Here is the next one. I think it's quite intuitive to use strtr() to remove single characters of a string, too, instead of using many str_replace($str, $chr, ""). I'd glad to see this change also in 5.4. Additionally, I've removed the lookup-table generation as gcc doesn't optimize this away. Ro