php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2852 argv/argc inconsistency while running as command-line script
Submitted: 1999-11-28 13:51 UTC Modified: 2000-05-22 20:32 UTC
From: stas at zend dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Beta 3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: stas at zend dot com
New email:
PHP Version: OS:

 

 [1999-11-28 13:51 UTC] stas at zend dot com
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).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-05-22 20:32 UTC] hholzgra at cvs dot php dot net
fixed in latest cvs
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 22:01:29 2024 UTC