On Wed, Jan 28, 2015 at 11:48 AM, Rowan Collins <rowan.coll...@gmail.com> wrote:
> Ferenc Kovacs wrote on 28/01/2015 07:20: > >> >> >> 2015.01.28. 6:04 ezt írta ("François Laupretre" <franc...@tekwire.net >> <mailto:franc...@tekwire.net>>): >> > >> > > De : Rowan Collins [mailto:rowan.coll...@gmail.com <mailto: >> rowan.coll...@gmail.com>] >> > > I would like to propose that the error given for an undefined constant >> > > should be raised from E_NOTICE, probably to E_RECOVERABLE_ERROR, in >> > > PHP 7. >> > >> > +1 >> > >> >> I don't like that. >> Depending if we want to keep the behavior on the long term I would either >> go with E_WARNING or E_DEPRECATED >> Turning it into E_RECOVERABLE_ERROR would be for most users just as bad >> as removing it while we still have to support the behavior so no real gain >> for us. >> >> > 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. > On the other hand, if the concern is having to support it, then it could > just be E_ERROR. The reason I chose E_RECOVERABLE_ERROR is because that had > recently been adopted for other things, such as invalid method calls. As I > mentioned in my original e-mail, the recovery behaviour needn't be the > existing string interpretation, but could just be to treat the value as > NULL, which would probably be simpler to implement. Personally, I've never > actually recovered an E_RECOVERABLE_ERROR, so am not sure what use cases we > should be supporting. ok, I was assuming that by turning it into E_RECOVERABLE_ERROR you would still keep the assuming string behavior if there is a custom error handler which returns true for this error. I think if we want to remove the assuming string feature, we should handle it the same way as we handle referencing undefined function call or class reference(and for consistency the same should be considered for "Undefined variable", which is also an E_NOTICE atm). at this point I think I would -1 on removing the assuming this, +0.5 on turning it into E_DEPRECATED and +1 on turning the "Use of undefined constant"/"Undefined variable" errors into E_WARNING. -- Ferenc Kovács @Tyr43l - http://tyrael.hu