Date: 09/14/00
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6751 Updated: No-cache Internet Explorer"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6750 Updated: passing undefined variables by reference mangles function parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
FYI: This is a bad one.
andré
attached mail follows:
ID: 6750
Updated by: waldschrott
Reported By: dshadow <email protected>
Status: Analyzed
Bug Type: Scripting Engine problem
Assigned To:
Comments:
argh, this is really bad, what seems to happen is (verified with modified tests):
if a non-existent variable (NULL works) is passed to the referenced parameter, *all* other parameters are overwritten with the value of the precessing variable the referenced one too, what explains the current buggy behaviour at the third function call
Previous Comments:
---------------------------------------------------------------------------
[2000-09-14 02:07:58] dshadow <email protected>
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);
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6750
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6751 Updated: No-cache Internet Explorer"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6750 Updated: passing undefined variables by reference mangles function parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

