Re: argv and argc on cliphp
| From: | Rasmus Lerdorf | Date: | Tue, 07 Oct 2003 03:18:22 +0000 |
| Subject: | Re: argv and argc on cliphp | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4704@lists.php.net to get a copy of this message | ||
On Mon, 6 Oct 2003, Greg MacLellan wrote:
> 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.
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.
-Rasmus