|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-08-05 00:10 UTC] shim at andersens dot org
Description:
------------
Passing Parameters to a function result in all parameters and variables being set to the last paramter.
I'd like to submit a ziped of sample of code that does this, but I'm haven't been able to extract the broken code from my program yet. It works sometimes, but not others.
Seems to depend on the number of classes I have included.
I'll update this when I have a working (broken) sample.
Reproduce code:
---------------
foo('a','b',c')
function foo( $a, $b, $c)
{
echo $a;
echo $b;
echo $c;
echo $d; // new varible
}
Expected result:
----------------
abc
Actual result:
--------------
cccc
-- Notice $d is also set to 'c'
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 20:00:01 2025 UTC |
foo('a','b',c') should be foo('a','b','c') also, are varibables are references to eachother. Changing one changes them all.Traced it down to a line that read <? function &Param($name) { return @$this->params[$name]; } ?> changing it to ... $v = $this->params[$name]; return $v; ... fixes it. Is this the same issue fixed in 4.4?