Re: argv and argc on cliphp
| From: | Greg MacLellan | Date: | Tue, 07 Oct 2003 03:10:21 +0000 |
| Subject: | Re: argv and argc on cliphp | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4703@lists.php.net to get a copy of this message | ||
> > > You're not breaking code (since it can always use $_SERVER) and you're
> > > not introducing any globals (which goes along with the
register_globals
> > > setting).
> >
> >Sure you are, you are creating the global $_SERVER which was specifically
> >not enabled in your scenario.
>
> I may be missing something, but that doesn't break any code. If you don't
> use it - it doesn't affect you. The chances of you using this variable
for
> other purposes is slim to non existent. Why not always have it available
> there too, for the sake of people who are already getting used to living
> without globally registered variables?
That was my argument. I was saying that instead of ALWAYS creating $argv and
$argc, regardless of register_global status, it should ALWAYS create
$_SERVER['argv'] and $_SERVER['argc'], regardless of variables_order
setting.
This has the double-edged effect of making it a standard to always use
$_SERVER['argv'] for cli, and to discourage people from removing S from
variables_order and using $_SERVER as their own variable name for something
else.
Making globals $argv and $argc always created is just cluttering the
namespace even more, and (I think) breaks the idea of always putting
variables into the superglobal $_* arrays.
ttyl, greg