Re: argv and argc on cliphp
| From: | Rasmus Lerdorf | Date: | Tue, 07 Oct 2003 14:02:21 +0000 |
| Subject: | Re: argv and argc on cliphp | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4730@lists.php.net to get a copy of this message | ||
On Tue, 7 Oct 2003, Zeev Suraski wrote:
> At 05:18 07/10/2003, Rasmus Lerdorf wrote:
> >My big problem with this approach is that when variables_order does not
> >include "S" then it seems inconsistent to have a partially populated
> >$_SERVER array. If $_SERVER['argc'] is there, why aren't other normal
> >$_SERVER variables available? The wtf factor is a little too high for my
> >tastes.
>
> I think that making $_SERVER dependant on the settings of variables_order
> was wrong to begin with (I may have caused it to be that way in the first
> place, I don't remember, but all the same, it appears wrong). All the
> tricks with variables_order/gpc_order were there to allow people to work
> around problems with register_globals. Linking them with the auto globals
> doesn't make any sense to me, and is the source of the wtf factor here to
> begin with.
>
> The only reason one may want not to populate the auto-globals is
> performance. I think that the cases where you would really like to disable
> one of those are rare. I think that our best bet is to always populate the
> auto globals, regardless of variables_order, and possibly provide means to
> explicitly turn them off for performance reasons.
But the means to turn them off is variables_order. Being able to disable
populating E and S can give a decent performance boost and for the most
part you never need these. Having register_argc_argv being dependant on
the variables_order setting is very confusing. If you specifically say
you want to register argc/argv, then that is what should happen.
-Rasmus