Re: PHP and case-sensitivity inconsistency in PHP 6

From: Date: Sun, 26 Jan 2014 23:21:39 +0000
Subject: Re: PHP and case-sensitivity inconsistency in PHP 6
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message


On 26/01/14 22:52, Chris Wright wrote:
I'm all for casing consistency. I'm very much *against* all-out case sensitivity. I don't want it to be possible to define a function foo and a function Foo that do different things.
Is there a particularly good reason why not? In maths, among other places, you would sometimes use lowercase and uppercase letters to mean related but different things. Also, I think, for the sake of sanity, we should simply make function, class, etc. names be opaque strings that PHP does not care about the contents of (aside from lexing concerns, of course). Because if PHP does care about them by trying to be case-insensitive, we just end up with silliness like this:
    function zumSchluß() {}
    ZUMSCHLUSS();
Resulting in this:
    PHP Fatal error:  Call to undefined function ZUMSCHLUSS() in command line code on line 2
Why's that silly? The uppercase form of ß is SS. PHP isn't case-insensitive at the moment, merely case-insensitive for ASCII only. Though that's a different matter entirely, I suppose. On a different note, your case-sensitive at declare, case-insensitive at use approach would not work well for consistency. Consider variables, for example. There is no difference (except for static variables, I suppose) between declaration and usage when we're dealing with assignments. Hence we'd have to have two sets of rules: Semi-case-insensitivity for functions, and case-sensitivity for variables. Yuck. I'd rather pick one system (preferably case-insensitivity) and use it everywhere. -- Andrea Faulds http://ajf.me/

Thread (15 messages)

« previous php.internals (#71614) next »