Bug 72921

Summary: PHP vars from command line broke on php-4.1.2
Product: [Retired] Red Hat Linux Reporter: Matthew Crawford <mcrawford>
Component: phpAssignee: Phil Copeland <copeland>
Status: CLOSED DUPLICATE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: rparish
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-08-29 20:09:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthew Crawford 2002-08-29 01:57:42 UTC
Description of Problem:
When passing vars to a php script from command line the last var is ignored once
upgrading to php-4.1.2.* All previous versions worked fine.

Version-Release number of selected component (if applicable):
php-4.1.2.*

How Reproducible:
create test.php
--------------------------
#!/usr/bin/php

<?php
print $valueone."\n";
print $valuetwo."\n";

?>
--------------------------

You will see the following results:
------------------------------------
[root@bevis root]# ./test.php "&valueone=testone&valuetwo=testtwo"
X-Powered-By: PHP/4.1.2
Content-type: text/html


testone
-----------------------------------

If you pass it a third value the second is now noticed and the third is ignored:
-----------------------------------
[root@bevis root]# ./test.php "&valueone=testone&valuetwo=testtwo&foo=bar"
X-Powered-By: PHP/4.1.2
Content-type: text/html


testone
testtwo
----------------------------------


Steps to Reproduce:
Above

Actual Results:
Above

Expected Results:
You should see all vars passed to php binary from command line. Version 4.1.2
seems to be droping the last one.

Additional Information:

All my scripts that had command line vars passed to them worked great until the
upgrade to 4.1.2. Seems to be a bug. Does not seem to be a problem when being
passed by apache. Only from command line shell.

Below I have included the exact same test preformed above with broken 4.1.2 here
with the previous version I was running of 4.0.6. As shown it works fine with this version.	
--------------
[root@rbl root]# ./test.sh "&valueone=testone&valuetwo=testtwo"
X-Powered-By: PHP/4.0.6
Content-type: text/html


testone
testtwo
--------------

Comment 1 Phil Copeland 2002-08-29 20:09:08 UTC
Slightly differnt version


[root@alpha root]# cat test.php
#!/usr/bin/php
<?php
print "test1 = [" . $_GET['valueone'] . "]\n";
print "test2 = [" . $_GET['valuetwo'] . "]\n";
var_dump($_GET);
?>

[root@alpha root]# ./test.php "&valueone=testone&valuetwo=testtwo"
X-Powered-By: PHP/4.1.2
Content-type: text/html

test1 = [testone]
test2 = []
array(2) {
  ["_/test_php_"]=>
  string(0) ""
  ["valueone"]=>
  string(7) "testone"
}


I see this also happens in 4.2.2


Also the add extra variable to end seems to vanish
[root@alpha root]# ./test.php "&valueone=testone&valuetwo=testtwo&fred="
X-Powered-By: PHP/4.1.2
Content-type: text/html

test1 = [testone]
test2 = [testtwo]
array(3) {
  ["_/test_php_"]=>
  string(0) ""
  ["valueone"]=>
  string(7) "testone"
  ["valuetwo"]=>
  string(7) "testtwo"
}

(wtf did fred= go?)

Phil
=--=


Comment 2 Phil Copeland 2002-08-29 20:13:35 UTC
Ok this looks similar enough to #72752 that I'm duping the bug


*** This bug has been marked as a duplicate of 72752 ***