Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53440 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62463 invoked from network); 20 Jun 2011 17:56:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2011 17:56:37 -0000 Authentication-Results: pb1.pair.com header.from=robert@xarg.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=robert@xarg.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain xarg.org from 209.85.212.42 cause and error) X-PHP-List-Original-Sender: robert@xarg.org X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:59584] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/F2-34681-4D98FFD4 for ; Mon, 20 Jun 2011 13:56:37 -0400 Received: by vwl1 with SMTP id 1so1383807vwl.29 for ; Mon, 20 Jun 2011 10:56:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.189.13 with SMTP id dc13mr1891089vcb.169.1308592594007; Mon, 20 Jun 2011 10:56:34 -0700 (PDT) Received: by 10.220.100.146 with HTTP; Mon, 20 Jun 2011 10:56:33 -0700 (PDT) X-Originating-IP: [92.225.216.141] In-Reply-To: References: Date: Mon, 20 Jun 2011 19:56:33 +0200 Message-ID: To: Gustavo Lopes Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=90e6ba4fc3aeb8b8b804a6287422 Subject: Re: [PHP-DEV] Changed behaviour for strtr() From: robert@xarg.org (Robert Eisele) --90e6ba4fc3aeb8b8b804a6287422 Content-Type: text/plain; charset=ISO-8859-1 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 > 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 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 > > --90e6ba4fc3aeb8b8b804a6287422--