Re: Complete case-sensitivity in PHP

From: Date: Fri, 20 Apr 2012 15:44:58 +0000
Subject: Re: Complete case-sensitivity in PHP
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-60239@lists.php.net to get a copy of this message
> 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. 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.

« previous php.internals (#60239) next »