PHP 4.0 Bug #2852: argv/argc inconsistency while running as command-line script
| From: | stas at zend dot com | Date: | Sun, 28 Nov 1999 12:51:14 +0000 |
| Subject: | PHP 4.0 Bug #2852: argv/argc inconsistency while running as command-line script | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-13220@lists.php.net to get a copy of this message | ||
From: stas@zend.com
Operating system: Linux
PHP version: 4.0 Beta 3
PHP Bug Type: Scripting Engine problem
Bug description: argv/argc inconsistency while running as command-line script
Following script (argv.php3):
#!/usr/bin/php -f
<?
printf("argc: %d\nargv1-2:%s-%s\n",$argc,$argv[0],$argv[1]);
?>
when run as ./argv.php3 (without parameters), says:
argc: 1
argv1-2:-
when run as ./argv.php3 abc (1 parameter), says:
argc: 1
argv1-2:abc-
Shouldn't argc be different in two cases? When I do not put -f, script name is included in argv
and argc is OK.
Same effects if I run php -f argv.php3 (like the first case) and php argv.php3 (like the second
case).