Re: [RFC][DISCUSSION] Deprecation of fallback to root scope

From: Date: Sun, 04 Feb 2018 22:43:04 +0000
Subject: Re: [RFC][DISCUSSION] Deprecation of fallback to root scope
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-101764@lists.php.net to get a copy of this message
On Sun, Feb 4, 2018 at 2:56 PM, Stanislav Malyshev <smalyshev@gmail.com> wrote: > Hi! > >> To get the same benefits (jit and such) wouldn't it be better to introduce >> a "use function root;" or similar statement or a declare() to specify this >> file imports all root functions? > > We already have this right now, and realistically speaking, who wouldn't > do that in their code instead of writing weird \strlen() code? Everybody > would configure their IDEs and so to insert this automatically. So we're > talking about RFC to make people work harder for what they already have > now and then end up in the same place we are already right now. I agree with Stas that this "use function root;" or whatever is pointless. >> was acted on at any time in the future. and in addition people will silence >> the notices on global error reporting level, because violations would > > And note also that we can't silence just this warning. Which means > people would have to silence *all* warnings, thus making all other > messages useless. This is not a good development and this is not what we > should be training users to do - saying "well, it's a warning, just > silence it" is the worth idea we could have. If we create a warning, > recommendation should be "it's important enough so we call your > attention to it, please deal with it", not "just silence it". If it's OK > in most cases (as opposed to rare exceptional cases) for it to be > silenced, it shouldn't be there in the first place. We have nearly zero E_STRICT warnings right now. Simply configure your error reporting level to omit E_STRICT if you don't want them. You are blowing this out of proportion.

« previous php.internals (#101764) next »