Re: PHP and case-sensitivity inconsistency in PHP 6
On 26 January 2014 23:21, Andrea Faulds <[email protected]> wrote:
> Why's that silly? The uppercase form of ß is SS. PHP isn't case-insensitive
> at the moment, merely case-insensitive for ASCII only.
>
This alters the issue somewhat - it opens up the unicode can of worms
and it's almost completely unresolvable without changing the rules for
identifiers fundamentally. At the moment identifiers can be ASCII
[a-zA-Z0-9] plus >=0x80, but no case translation is performed outside
the bounds of ASCII [a-zA-Z0-9] - if we were to start interpolating
case outside these bounds the a) we'd need to pick a standard set of
valid code points (presumably unicode?) and we'd need to start doing
some (relatively) complex validation of names.
> 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.
This is true, but essentially what I'm suggesting is that the check is
performed at the point where an entry is created in the relevant
symbol table - if an operation would end up creating a thing that
already exists with a different casing, blow up. This is already what
happens for function/class etc declarations, I'm just suggesting
extending this to variables.
Thanks, Chris
Thread (15 messages)