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 that expects this feature in both modes, the array-mode and
the string-mode?

And yes, it would be a third completely different algorithm. But every
algorithm is specialized for one use-case, and I think we shouldn't decide
such things based on the number of algorithms used; especially for such a
basic function where the result should be calculated as fast as possible, no
matter which algorithm led to the final result.

You also call it a BC break, what did I missed? If we agree with this
feature, we could, of course, search for a different syntax; but it was the
most obvious.

Robert

2011/6/20 Gustavo Lopes <glo...@nebm.ist.utl.pt>

> Em Mon, 20 Jun 2011 12:32:30 +0100, Robert Eisele <rob...@xarg.org>
> 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 strtr, which (IMO unwisely) already
> provides two completely different algorithms.
>
> --
> Gustavo Lopes
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to