Ferenc Kovacs wrote on 28/01/2015 16:42:


On Wed, Jan 28, 2015 at 4:42 PM, Rowan Collins <rowan.coll...@gmail.com <mailto:rowan.coll...@gmail.com>> wrote:

    Ferenc Kovacs wrote on 28/01/2015 12:13:


            E_DEPRECATED is likely to be even more ignored than
        E_NOTICE, so
            would be a step backwards; my whole assumption is that
        most people
            getting the message are not using a deprecated feature, but
            accidentally mis-typing a constant or keyword. I'd be
        happy with
            raising it to E_WARNING to make it more noticeable,
        though, if we
            don't think removing the functionality is acceptable.


        turn it into E_WARNING if we are planning to keep the feature,
        turn it into E_DEPRECATED if we want to remove the feature
        later on.


    I see absolutely no advantage in changing this into E_DEPRECATED,
    as it's even more likely to be hidden or ignored than E_NOTICE.


removing a feature (which is present in the language since 4.0, probably even previously) without marking it deprecated first would be a rude move imo.
so if we want to remove it, I can't see any other way.

The only documentation I can find mentioning it explicitly discourages is it, so I don't think it's a huge stretch to say that it's already deprecated, but if we feel that's not enough, we may not want to jump straight to fatal. However, I don't think changing to E_DEPRECATED is the only, or best, way of warning people of future removal.


(ofc. you can also try to detect this specific usage with static analysis, but that would still miss dynamic usages like eval).

Actually, I was going to mention that it's quite hard to spot with static analysis, because like classes and functions, you have to chase includes to know what's defined. Unless you look for bare words which aren't all caps, I suppose.


    If we want to keep the string fallback for now, how about we raise
    the severity to E_WARNING, and change the message to mention
    deprecation?
    e.g.
    Warning: Use of undefined constant foo - assumed 'foo', but this
    behaviour will change in a future version


I don't like mixing the deprecation notice in the string but maybe it's just me.

I know it's unusual, but I think really there are two messages we're expressing: "Warning: Undefined constant" and "Deprecated: Using unquoted string". Unless we issue both at once (which seems unnecessarily confusing), I think the higher of the two severities should be used. But maybe that's just me, I'll see what others think.

Regards,
--
Rowan Collins
[IMSoP]

Reply via email to