#36051 [Asn->Bgs]: Suspicous reference-argument behavour at func($m=null)
| From: | dmitry@php.net | Date: | Thu, 19 Jan 2006 07:31:27 +0000 |
| Subject: | #36051 [Asn->Bgs]: Suspicous reference-argument behavour at func($m=null) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-92175@lists.php.net to get a copy of this message | ||
ID: 36051
Updated by: dmitry@php.net
Reported By: php at koterov dot ru
-Status: Assigned
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows XP
PHP Version: 5.1.2
Assigned To: dmitry
New Comment:
See comments: http://bugs.php.net/bug.php?id=35995
Previous Comments:
------------------------------------------------------------------------
[2006-01-17 15:43:29] derick@php.net
Dmitry, this is another one similar - I really think we should address
this issue to the PHP 5.1.1 situation.
------------------------------------------------------------------------
[2006-01-17 15:42:04] php at koterov dot ru
Description:
------------
Seems assignment-and-passing by reference becomes broken in PHP 5.1.
PHP 4.x and 5.0 work as expected. See sample below.
Seems PHP assigns value to $x AFTER calling function f(), but NOT
before it. Or - only copy of $x passed to f(), not $x itself (as in 4.0
& 5.0).
Reproduce code:
---------------
<?php
function f(&$m)
{
$m = 123;
}
f($x=0);
var_dump($x);
?>
Expected result:
----------------
int(123)
Actual result:
--------------
int(0)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36051&edit=1