Bug #9289 Updated: Command line argument list inaccurate
| From: | jmoore@php.net | Date: | Tue, 08 May 2001 00:30:31 +0000 |
| Subject: | Bug #9289 Updated: Command line argument list inaccurate | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-54322@lists.php.net to get a copy of this message | ||
ID: 9289
Updated by: jmoore
Reported By: reinke@e-softinc.com
Status: Critical
Bug Type: Unknown/Other Function
Operating system:
PHP Version: 4.0.4pl1
Assigned To:
Comments:
Reproducable under Win2k.
- James
Previous Comments:
---------------------------------------------------------------------------
[2001-02-15 14:48:09] reinke@e-softinc.com
PHP, when being run from the command line, has been mangling
the command line arguments badly for some while. It would be
nice if they mapped to the same usage as C programs.
PHP4.04pl1 is particularly bad - argc is completely broken:
Consider the script
<? printf("%dn", $argc); ?>
Here's the output from php4.01, and then from php4.04pl1
$ php -f test.php
0
$ php -f test.php a
1
$ php -f test.php a b
2
$ php -f test.php a b c
3
$ /home/webapps/webserver/bin/php404pl1 -f test.php
2
$ /home/webapps/webserver/bin/php404pl1 -f test.php a
2
$ /home/webapps/webserver/bin/php404pl1 -f test.php a b
3
$ /home/webapps/webserver/bin/php404pl1 -f test.php a b c
4
As you can see, argc is never less than 2, and in fact is a value
of 2 with zero args or one arg (bad bad bad!).
Sort of important for us - we find PHP SO EASY to program in,
that we actually use it as the language of choice, even for batch
programming, when performance is not absolutely critical.
But it sort of makes it tough to pass in cmd line arguments...
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9289&edit=2