|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-09-14 03:09 UTC] waldschrott@php.net
[2000-12-16 13:49 UTC] waldschrott@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Jun 28 05:00:01 2026 UTC |
Passing an undefined variable or function result to a function expecting said parameter by reference mangles the function parameters. The following script results in this output: SomeFunc(2, 2, 2) //this is really bad SomeFunc(1, 2, 1) //This is correct SomeFunc(1, 2, 2) //This isn't correct, but it's not good either This bug is in PHP 4.0.2 and the 4.0.3 CVS. The earliest version I know of with the problem is a 4.0.2 CVS with a build date of Jul 21, so the problem has existed since at least then. --- function returnUndef() { return $foo; } function returnDef() { return 1; } function SomeFunc($a, $b, &$c) { echo("SomeFunc($a, $b, $c)\n"); } SomeFunc(1, 2, returnUndef()); SomeFunc(1, 2, returnDef()); SomeFunc(1, 2, $bar);