#19444 [Opn]: argv is parsed differently when script is run via shebang vs run via php -f

From: Date: Tue, 17 Sep 2002 00:49:19 +0000
Subject: #19444 [Opn]: 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-19504@lists.php.net to get a copy of this message
ID: 19444 User updated by: yoglets@hotmail.com Reported By: yoglets@hotmail.com Status: Open Bug Type: Scripting Engine problem Operating System: RedHat 7.3 PHP Version: 4.2.3 New Comment: Doh, I'm an idiot. % php -f test.php -- --a=1 --b=2 --c=3 Duh. Nevermind. :( Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#19504) next »