Page 1 of 1

=& Question

Posted: Fri Sep 28, 2007 9:39 am
by olog-hai
Hey,

In PHP 5 we have no longer have to put "&" after = to use reference right ? cause by defaut php 5 do not make copy of object right ?

If I do this

Code: Select all

$obj = new MyClass();
the $obj will content the reference of the object

why this code do a copy of the object instead of copy the reference ?

Code: Select all

$a = array();

$a["test"] = new MyClass();
$a["test"] is a copy of MyClass and not reference, why i have to specify =& to get the reference ?

thanks.

Posted: Fri Sep 28, 2007 10:07 am
by John Cartwright
Works fine for me..

Care to post where it is actually not working?

Posted: Fri Sep 28, 2007 10:16 am
by feyd
What version of PHP 5 are you seeing this on? Where's the proof it's a copy?

Posted: Fri Sep 28, 2007 10:24 am
by olog-hai
8O

sorry guys it works perfectly.

you can delete this post