Re: argv and argc on cliphp
| From: | Rasmus Lerdorf | Date: | Fri, 03 Oct 2003 15:28:58 +0000 |
| Subject: | Re: argv and argc on cliphp | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4664@lists.php.net to get a copy of this message | ||
On Fri, 3 Oct 2003, Greg MacLellan wrote:
> Rasmus Lerdorf wrote:
> > Andrei and I discussed this change and at the conceptual level at least
> > $_SERVER should be populated with argc and argv if variables_order
> > includes "S". If you have specifically configured your system to not
> > create $_SERVER, then of course it shouldn't be there. The change was to
> > always make argc and argv available in the CLI version regardless of the
> > variables_order setting. As in, the CLI version will now always populate
> > the global $argc and $argv variables.
>
> I don't really like the idea of populating two global variables, and I'm
> not sure where this is at right now, since I've only been following
> internals for the last few weeks. It's a good idea to be sure that argv
> and argc are always available (though, arguably, argc is not all that
> useful), but it would probably make more sense to put them in $_SERVER
> (and without the rest of the $_SERVER variables, if variables_order
> doesn't include "S").
>
> 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. To me it is more consistent with every
other language out there to make $argc and $argv available directly.
-Rasmus