Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60241 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23575 invoked from network); 20 Apr 2012 17:57:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2012 17:57:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-wg0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:44553] helo=mail-wg0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 96/B9-63732-183A19F4 for ; Fri, 20 Apr 2012 13:57:22 -0400 Received: by wgbfg15 with SMTP id fg15so4398354wgb.11 for ; Fri, 20 Apr 2012 10:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=PbudGFTR11SqEtgdFbMLC8CCuDx7ZqRZl0bbD1VpKA4=; b=H3JK+9fR7ncKEj/yv9Ug+BIOeqT4QySqqnvXZcK10dFFPTMZJy2+0HTwnNC8gvJx8w zYzUrlyheWcMKKgi+aER44FN/rkuf6jXNpb7L9Ml4m76GoEg6t+M5+FqT1I2TqyqYmEV hpmo5mxpB0Yb8YXQgk06mqk3xXg6RAaH+PXH8wHEsRvv7AkxZ/4dJLObMdtV3elB80MA fNP3gnGTKLdJotH1FkvZ2DqLgWbKpKiEz9eKwToXf62Z3gQlLtGm64XKXnqNZ17tkdgw 2u46TNvwoMwSEgSurmhYWacnKPUXsdZrUxWsfucfGwwO74EJg3Fb3+R68fUxLhn+gNxA 92mg== MIME-Version: 1.0 Received: by 10.216.214.84 with SMTP id b62mr4454599wep.20.1334944638589; Fri, 20 Apr 2012 10:57:18 -0700 (PDT) Received: by 10.223.1.82 with HTTP; Fri, 20 Apr 2012 10:57:18 -0700 (PDT) In-Reply-To: References: Date: Fri, 20 Apr 2012 10:57:18 -0700 Message-ID: To: Sherif Ramadan Cc: John LeSueur , Arvids Godjuks , internals@lists.php.net Content-Type: multipart/alternative; boundary=0016e6dee821fa5c8a04be200473 Subject: Re: [PHP-DEV] Complete case-sensitivity in PHP From: kris.craig@gmail.com (Kris Craig) --0016e6dee821fa5c8a04be200473 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Apr 20, 2012 at 8:44 AM, Sherif Ramadan wrote: > > But in order to be case insensitive, PHP needs to know that > strtolower("A") > > == 'a'. So if you use Cyrilic for userland functions/classes, php needs a > > cyrillic aware strtolower function. Then the problem is that core > > classes/functions need to use a plain ASCII strtolower for case > > insensitivity. So you cannot both write code in cyrillic and interface > with > > plain ASCII internals. One possible, but less than optimal solution is to > > first try a locale aware strtolower, then try a plain ascii strtolower > when > > looking up symbols. > > > > John > > I can see the confusion about PHP's case-sensitivity and how it mixes > and matches between case-insensitive functions/classes/(arguably even > constants), and case-sensitive variable names, for example. > > Its naming rules are a little bit inconsistent in that regard. I just > don't see a point in making it completely locale aware. The fact that > you can do soefunc() and SOMEFUNC() and still invoke the same function > is a benefit. Could you elaborate? Aside from making PHP forgiving of typos and overall laziness on the part of the coder, and of course BC notwithstanding, I'm not sure I understand what benefit there is to preserving this inconsistent behavior. > And I suppose for those using UTF-8 encoded function > names it might be convenient to make them case-sensitive as well. I'm > not going to argue that it's not. I'm just going to say that it > doesn't seem to be a significant problem. > When I was at Microsoft, I got into a little argument with some folks from the Windows division about this very issue-- except, in this case, it was about case-sensitivity in the filesystem. They essentially made the same argument; i.e. "Why would you want 'Find.exe' and 'find.exe' to be two separate things?!" I countered that I may want to add a library to the PATH that contains a file with the same name, such as UnxUtils. "Why would you want to do that?! Windows' find.exe is way better than the Unix one, anyway!".... And then my brain exploded. Turkish localization notwithstanding (I confess that I know absolutely * nothing* about that lol), one possible use-case could be if you're including an external library/framework that contains a function with the same name but different case. I'm not sure how likely that is, mind you, but I can see that as one potential benefit. Either way, I guess my point is that the arguments for/against this seem to parallel the arguments for Windows-style fso case-insensitivity vs. Unix-style fso case-sensitivity. --Kris > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --0016e6dee821fa5c8a04be200473--