Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83643 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34606 invoked from network); 24 Feb 2015 08:27:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2015 08:27:31 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.214 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.214 mail4-2.serversure.net Linux 2.6 Received: from [217.147.176.214] ([217.147.176.214:51748] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/05-09240-0F53CE45 for ; Tue, 24 Feb 2015 03:27:30 -0500 Received: (qmail 15040 invoked by uid 89); 24 Feb 2015 08:27:26 -0000 Received: by simscan 1.3.1 ppid: 15034, pid: 15037, t: 0.0972s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@86.189.147.37) by mail4.serversure.net with ESMTPA; 24 Feb 2015 08:27:26 -0000 Message-ID: <54EC35ED.1080905@lsces.co.uk> Date: Tue, 24 Feb 2015 08:27:25 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [Discussion] Last chance for case-sensitive engine From: lester@lsces.co.uk (Lester Caine) On 24/02/15 08:02, Pavel KouĊ™il wrote: >> I want to ask this question one more time before PHP7 feature freeze: can >> > we the engine case sensitive from PHP>=7.0? >> > >> > There is a draft for that: https://wiki.php.net/rfc/case-sensitivity >> > (mostly empty), so I decided to ask this question in the internals mail >> > list. >> > >> > Pros: more simple O(1) hash table checks for properties, functions, >> > methods, classes without strtolower normalization on the engine/parser >> > level. Consistency with unicode class names (yes, they are case sensitive, >> > check http://3v4l.org/ia0pc), consistency with exisiting PSR0,4 standards >> > (case sensitive mapping of class names to the file names) >> > >> > From my experience, all modern PHP framework don't use case-insensitive >> > code, so chance to break anything for them is really low. >> > >> > Cons: on the extension level things aren't so good and can be some BC >> > breaks (like with phpng) >> > >> > Possible ways: >> > >> > 1) Keep PHP engine case-insensitive for PHP7 >> > 2) Make PHP engine case-sensitive since PHP7 with possible minor BC breaks >> > in the extensions (this breaks can be easily fixed) >> > 3) Add a compile-time switch, eg. --with-case-sensitivity to the >> > configuration to have an ability to build PHP with sensitivity and make >> > this option enabled by default since next major version (PHP>=8.0). Add >> > deprecation notices in 7.x >> > >> > Thoughts? > Hello, > > I'd personally LOVE PHP being case-sensitive, but I think it's not possible. > > Sure, frameworks and newer code will won't be broken, but what about > the tons of "legacy" code? Personally, I saw too much code (and even > examples in tutorials!) using stuff like MySQL_Query(). And case > sensitivity would break this code without a doubt. (I know mysql ext > is deprecated, but that's relevant right now, this is just one of many > examples - the most common one I can think of, actually). > > On the other hand, this could be fixed by running some migration > scripts over code base, so maybe it's not THAT bad? Who knows. It is fun that some areas are already case sensitive, such as the returns from a database which under the SQL standard defaults to upper case while the convention in code tends to be lower case. One has to convert result arrays case often when trying to work cross platform. However I think that the situation with regards Unicode seems to have been lost in the current battlefield? That a string value needs to be handled with mbstring is another little problem which requires care when pushing strings around. Introducing case-sensitive E_STRICT now would allow an eventual incorporation of proper multilingual support later. Keeping some areas 'English only' does not bother me, but the rest of the infrastructure has already moved on so it is about time PHP joined modern practice? One of the areas that many people may already have worked through is moving from case-insensitive file names in Windows to case-sensitive ones on other platforms which are now a lot more prevalent, so some of the 'BC' problems are outside our control anyway. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk