Re: Deprecate and remove case-insensitive constants?

From: Date: Thu, 14 Sep 2017 15:45:16 +0000
Subject: Re: Deprecate and remove case-insensitive constants?
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-100597@lists.php.net to get a copy of this message
On Thu, Sep 14, 2017 at 11:37 AM, François Laupretre <francois@tekwire.net> wrote: > Le 14/09/2017 à 15:38, Alain Williams a écrit : >> >> I vote for making it case sensitive: simpler for the parser; the >> programmer >> rapidly learns that it should be 'TRUE' and not 'true' -- job done. > > > No need to force people to switch their code to 'TRUE'. Just supporting > case-sensitive 'TRUE', 'true', and 'True' (the same for false and > null) > should be enough. Not supporting 'tRUE' or 'TrUe' anymore will also be a > positive side effect for code readability. > +0.9 this. It feels pretty simple to resolve this special-case for case-sensitivity at any stage of the compile, but the reality is that TRUE/True/true covers 99% of uses, and a static analyzer can *trivially* find those other cases prior to an upgrade. Heck, 3 minutes with a token_get_all() script can find 'em, even produce a rewrite diff if you're so inclined. Nevermind, make that +1. The ease of auditing mixed-case uses makes supporting it in the compiler not worth the maintenance. -Sara

« previous php.internals (#100597) next »