#19444 [Opn->Bgs]: argv is parsed differently when script is run via shebang vs run via php -f
| From: | edink@php.net | Date: | Tue, 17 Sep 2002 05:11:18 +0000 |
| Subject: | #19444 [Opn->Bgs]: argv is parsed differently when script is run via shebang vs run via php -f | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-19508@lists.php.net to get a copy of this message | ||
ID: 19444
Updated by: edink@php.net
Reported By: yoglets@hotmail.com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: RedHat 7.3
PHP Version: 4.2.3
Previous Comments:
------------------------------------------------------------------------
[2002-09-16 19:49:19] yoglets@hotmail.com
Doh, I'm an idiot.
% php -f test.php -- --a=1 --b=2 --c=3
Duh. Nevermind. :(
------------------------------------------------------------------------
[2002-09-16 19:44:06] yoglets@hotmail.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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19444&edit=1