Re: Proposal: Raise severity of undefined constants
| From: | Andrey Andreev | Date: | Wed, 28 Jan 2015 11:43:53 +0000 |
| Subject: | Re: Proposal: Raise severity of undefined constants | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81303@lists.php.net to get a copy of this message | ||
HI,
On Wed, Jan 28, 2015 at 12:34 PM, Rowan Collins <rowan.collins@gmail.com> wrote:
> Benjamin Eberlei wrote on 28/01/2015 08:43:
>>
>> I think this is too big a BC break.
>>
>> The usage of $array[key] = 0 instead of "key" is widespread.
>
>
> As I mentioned, the advice *not* to write that has been in the manual since
> 2001, so I can't think why any tutorial or example code would teach it as
> the right way, but it is possible, I suppose.
>
> I realise the majority of code is not available publicly, but it would be
> good to make some attempt to judge whether it really is widespread, so if
> you have any examples or way of measuring it, that would be useful.
From what I've seen, most developers seem to put everything in quotes
- strings (obviously), integers, floats, even numeric array keys ...
boolean and null being the only exceptions (but I've seen that too).
No opinion on the subject, just my observations.
Cheers,
Andrey.