On Sun, Jan 29, 2017 at 8:33 PM, Rowan Collins <rowan.coll...@gmail.com>
wrote:

> Good evening all!
>
> Currently, if the constant FROB_ACTIVE is not defined, the code "echo
> FROB_ACTIVE;" results in an E_NOTICE and the string 'FROB_ACTIVE' being
> displayed. I would like to propose that this be changed to an E_WARNING in
> PHP 7.2, and to an Error in PHP 8.0.
>
> My reasoning for this includes:
>
> - consistency with other "undefined" errors, including the otherwise
> identical "echo \FROB_ACTIVE;"
> - the fallback to string appears to be largely undocumented except to
> discourage its use
> - the error can mask serious bugs, such as when mis-typing keywords
>
> I have tried to anticipate some of the questions that will be raised, so
> have drafted an RFC rather than trying to fit all the detail into one
> e-mail: https://wiki.php.net/rfc/deprecate-bareword-strings
>
> Please read my proposal, and let me know your thoughts. I have placed the
> RFC "under discussion", but will be happy to modify it based on feedback,
> and am in no haste to put it to a vote.
>

Fully agree with this proposal.

Also agree with the choice of throwing a Warning instead of a Deprecation.
Throwing a Deprecation would essentially *downgrade* the current error
level, which does not appear to be prudent.

Nikita

Reply via email to