Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60249 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67009 invoked from network); 21 Apr 2012 01:38:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Apr 2012 01:38:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=ww.galen@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ww.galen@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.170 as permitted sender) X-PHP-List-Original-Sender: ww.galen@gmail.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:48894] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/20-63732-19F029F4 for ; Fri, 20 Apr 2012 21:38:26 -0400 Received: by iaeh11 with SMTP id h11so16776457iae.29 for ; Fri, 20 Apr 2012 18:38:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=oRk5y4MMaxYh5BagJ3FnHs2zBQMRtSNTjsXW5KtnOiY=; b=ynQ8qXbzAkN5Wuj6aYRb0dIFT4MkqmozYciU/jJG7V5I7If1lJk9iAiM49tF340Li6 VQ/PXwbvlSjv3hFjz4UFuIRPl/3xxmbIQR/cyGUta+gb4IkEyMENXLlb8gIeAK6CcbGZ G/HADteUCoLnGolQM7crAm+wPQL+F8a+2QjKMztvFC4u3WCMqI798hVNRqdRUC0fevkx nClrtFpKc4r4N4S8RRKPvzAPJs4ceH0M9SAKf1twbfp/WlwKejj1dJyG0OGfDFpkEsk7 bKfQEYtI5o2EkMFhgpkCxYvooCiO8EL/725WA0kHcggwTxB5Gkl0f0bhCWcGWWoHmKPR P08g== Received: by 10.50.212.97 with SMTP id nj1mr604085igc.65.1334972302990; Fri, 20 Apr 2012 18:38:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.144.201 with HTTP; Fri, 20 Apr 2012 18:37:42 -0700 (PDT) In-Reply-To: References: Date: Fri, 20 Apr 2012 18:37:42 -0700 Message-ID: To: "C.Koy" Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=14dae9340d19e79ce604be267586 Subject: Re: [PHP-DEV] Complete case-sensitivity in PHP From: ww.galen@gmail.com (Galen Wright-Watson) --14dae9340d19e79ce604be267586 Content-Type: text/plain; charset=ISO-8859-9 Content-Transfer-Encoding: quoted-printable On Fri, Apr 20, 2012 at 3:20 AM, C.Koy wrote: > > As the recent comments on that page indicate, there's not a deterministic > way to resolve this issue, apart from eliminating tolower() calls for > function/class names during lookup. Hence totally case-sensitive PHP. > > What about instead creating a special-purpose Zend function to normalize class names (zend_normalize_class_name, or zend_classname_tolower)? This function would examine the current locale and, if it's a problematic one, convert the string to lower case on its own (calling zend_tolower on non-problematic characters). Alternatively, zend_normalize_class_name could switch LC_CTYPE to an appropriate locale (e.g. "UTF-8"; the locale could be determined at compile time), call zend_str_tolower_copy, then switch back before returning. Then, any appropriate function (e.g. zend_resolve_class_name, zend_lookup_class_ex, class_exists, class_alias) would call zend_normalize_class_name instead of zend_str_tolower_copy/ zend_str_tolower_dup. The two problems with this approach are 1) additional time-cost. However, if done right, this should have little impact. 2) break class names using words in the locale-language. For example, a class named "IzgaraG=F6r=FCn=FCm=FC" would be converted to "izgarag=F6r=FCn= =FCm=FC", rather than "=FDzgarag=F6r=FCn=FCm=FC". However, this impact should be less than t= hat caused by the current bug. Does this bug pop-up for locales other than Turkish, Azerbaijani and Kurdis= h ? --14dae9340d19e79ce604be267586--