ID:               40981
 User updated by:  sir dot mordred dot service at gmail dot com
 Reported By:      sir dot mordred dot service at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Windows XP, apache 2.0
 PHP Version:      4.4.6
 New Comment:

Got it, sorry, my bad. Changing status to "Bogus".


Previous Comments:
------------------------------------------------------------------------

[2007-04-02 20:19:43] [EMAIL PROTECTED]

Recommended reading:
http://www.php.net/manual/en/language.references.php
http://www.php.net/manual/en/language.references.arent.php

------------------------------------------------------------------------

[2007-04-02 20:07:30] sir dot mordred dot service at gmail dot com

Description:
------------
If a parameter passed by reference to a function is assigned a new
object with the =& operator, after the function call the variable passed
to the function will not contain the object, but its previous value (or
null). Assignment with = works fine.

Reproduce code:
---------------
<pre><?php

class A {}

function Foo(&$param)
{
        $param =& new A();
}

function Bar(&$param)
{
        $param = new A();
}

echo phpversion()."\n";

$p = 1;
Foo($p);
var_dump($p);

$q = 1;
Bar($q);
var_dump($q);

?>


Expected result:
----------------
4.4.6
object(a)(0) {
}
object(a)(0) {
}

Actual result:
--------------
4.4.6
int(1)
object(a)(0) {
}


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40981&edit=1

Reply via email to