From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      4.0.4pl1
PHP Bug Type:     Unknown/Other Function
Bug description:  Command line argument list inaccurate

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("%d\n", $argc); ?>

Here's the output from php4.01, and then from php4.04pl1

$ php -f test.php
$ php -f test.php a
$ php -f test.php a b
$ php -f test.php a b c

$ /home/webapps/webserver/bin/php404pl1 -f test.php
$ /home/webapps/webserver/bin/php404pl1 -f test.php a
$ /home/webapps/webserver/bin/php404pl1 -f test.php a b
$ /home/webapps/webserver/bin/php404pl1 -f test.php a b c

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...

Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to