Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79826 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23618 invoked from network); 20 Dec 2014 22:44:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Dec 2014 22:44:30 -0000 Authentication-Results: pb1.pair.com header.from=addw@phcomp.co.uk; sender-id=permerror Authentication-Results: pb1.pair.com smtp.mail=addw@phcomp.co.uk; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain phcomp.co.uk designates 78.32.209.33 as permitted sender) X-PHP-List-Original-Sender: addw@phcomp.co.uk X-Host-Fingerprint: 78.32.209.33 freshmint.phcomp.co.uk Received: from [78.32.209.33] ([78.32.209.33:55483] helo=mint.phcomp.co.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F7/71-12790-BCBF5945 for ; Sat, 20 Dec 2014 17:44:28 -0500 Received: from addw by mint.phcomp.co.uk with local (Exim 4.72) (envelope-from ) id 1Y2Sl6-0004sp-Fu for internals@lists.php.net; Sat, 20 Dec 2014 22:44:24 +0000 Date: Sat, 20 Dec 2014 22:44:24 +0000 To: internals@lists.php.net Message-ID: <20141220224424.GG11370@phcomp.co.uk> Mail-Followup-To: internals@lists.php.net References: <000c01d01ca0$7e70c850$7b5258f0$@yahoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000c01d01ca0$7e70c850$7b5258f0$@yahoo.fr> Organization: Parliament Hill Computers Ltd User-Agent: Mutt/1.5.20 (2009-12-10) Subject: Re: [PHP-DEV] Proposal for PHP 7 : case-sensitive symbols From: addw@phcomp.co.uk (Alain Williams) On Sat, Dec 20, 2014 at 11:01:23PM +0100, F & N Laupretre wrote: > Hi, > > > > I don't know if this was discussed before. So, tell me what you think before > I write an RFC. > > > > I would like to propose that namespaces, functions, and classes become > case-sensitive (constants are already case-sensitive). Actually, I never > understood why they are case-insensitive. Even if the performance gain is > negligible, I think it could be the right time to question this. Variables are also case sensitive. Identifiers can contain a-zA-Z0-9_ + where top bit is set. Where an identifier is a function name or class name comparison is in a case insensitive manner ... but only for ASCII ... using tolower_map in zend_operators.c This means that those who write function (etc) names in some encoding that is more than US ASCII find that case comparison is done in a case sensitive manner - at least for those parts of identifiers that are written in characters that have the top bit set. Fixing this would require a lot of work as well as some way of determining what character encoding the source file was written in ... different includes might have different encodings. We recently talked about a way of specifying source file encoding and decided that it was not something to look at now (IIRC). Making namespaces, function & classes case sensitive makes PHP consistent to everyone - not just us 'US ASCII chauvinists' -- it is also the simplest approach. It is a BC break; one which, unfortunately, cannot be found at compile time. However: code, when fixed (ie consistent case spelling), will continue to work with current PHP implementations. Although many do try to write these identifiers in a case consistent manner it will cause problems, however I would suggest that it would be worth doing. -- Alain Williams Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer. +44 (0) 787 668 0256 http://www.phcomp.co.uk/ Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php #include