php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19444 argv is parsed differently when script is run via shebang vs run via php -f
Submitted: 2002-09-16 19:44 UTC Modified: 2002-09-17 00:11 UTC
From: yoglets at hotmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.2.3 OS: RedHat 7.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: yoglets at hotmail dot com
New email:
PHP Version: OS:

 

 [2002-09-16 19:44 UTC] yoglets at hotmail dot com
Given the script:

<? print_r($_SERVER['argv']); ?>

When run via a shebang within the file:

% test.php --a=1 --b=2 --c=3
Array
(
    [0] => ./test.php
    [1] => --a=1
    [2] => --b=2
    [3] => --c=3
)

Ok, that's good. Now, running the same script by calling the PHP binary directly:

% php -f test.php --a=1 --b=2 --c=3
Array
(
    [0] => test.php
    [1] => --b=2
    [2] => --c=3
)

Hey, where's my --a=1? I get these same results with 4.2.2 CGI, 4.2.3 CGI, and 4.2.3 CLI.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-16 19:49 UTC] yoglets at hotmail dot com
Doh, I'm an idiot.

% php -f test.php -- --a=1 --b=2 --c=3

Duh. Nevermind. :(
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 16:00:02 2026 UTC