Bug 72921 - PHP vars from command line broke on php-4.1.2
PHP vars from command line broke on php-4.1.2
Status: CLOSED DUPLICATE of bug 72752
Product: Red Hat Linux
Classification: Retired
Component: php (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Copeland
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-08-28 21:57 EDT by Matthew Crawford
Modified: 2007-04-18 12:46 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-08-29 16:09:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matthew Crawford 2002-08-28 21:57:42 EDT
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 16:09:08 EDT
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 16:13:35 EDT
Ok this looks similar enough to #72752 that I'm duping the bug


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

Note You need to log in before you can comment on or make changes to this bug.