Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53503 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57866 invoked from network); 22 Jun 2011 07:44:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2011 07:44:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=j.boggiano@seld.be; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=j.boggiano@seld.be; sender-id=pass Received-SPF: pass (pb1.pair.com: domain seld.be designates 209.85.214.42 as permitted sender) X-PHP-List-Original-Sender: j.boggiano@seld.be X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:41009] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 17/01-46075-45D910E4 for ; Wed, 22 Jun 2011 03:44:22 -0400 Received: by bwz18 with SMTP id 18so577782bwz.29 for ; Wed, 22 Jun 2011 00:44:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.143.4 with SMTP id s4mr270357bku.98.1308728656427; Wed, 22 Jun 2011 00:44:16 -0700 (PDT) Received: by 10.204.113.70 with HTTP; Wed, 22 Jun 2011 00:44:16 -0700 (PDT) In-Reply-To: <1353048461.20110621213024@cypressintegrated.com> References: <4DFF7C28.30100@sugarcrm.com> <1353048461.20110621213024@cypressintegrated.com> Date: Wed, 22 Jun 2011 09:44:16 +0200 Message-ID: To: Sanford Whiteman Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Changed behaviour for strtr() From: j.boggiano@seld.be (Jordi Boggiano) On Wed, Jun 22, 2011 at 3:30 AM, Sanford Whiteman wrote: >> Right now strtr('anything', 'anything', '') =3D=3D=3D 'anything', which >> means that anyone relying on this behavior is doing something strange >> and dumb imo, doing a function call for nothing. > > How =A0is relying on by-design behavior that turns the call into a no-op > (instead =A0of =A0wrapping the call in an empty() check or whatever) dumb= ? > Is =A0there =A0some =A0performance =A0hit for entering strtr() that makes= this > true? Well, all I was saying was that you'd never hardcode such thing, it could happen with dynamic user input, but in that case you'd have a string, and not null. Anyway as always with PHP there's probably a couple guys somewhere in the world that did it in a way that BC will break for them. I just think it's awkward to deny this feature for a possible edge case in which BC would be broken, while in other instances BC is broken in bigger ways, sometimes by accident, and sometimes in minor versions too. Cheers --=20 Jordi Boggiano @seldaek :: http://seld.be/