Hi,

I'm just trying to get my head around references and the uses etc... I
have reviewed the manual section on this a few times but I'm still a bit
fuzzy on it.

First of all, here's some code I'm using to pass a reference to an
object (which has global scope) to the constructor of a class "Site":

function Site(&$dbObj)
{
 $this->db = $dbObj;
}

I think what should happen here is that $this->db is now a reference to
the global version of the object, by way of the "&" in the function
defn. Is this correct? 

Also, I'm not sure about the benefits of using references as opposed to
copies. If anyone would like to elaborate on the reasons for using a
reference instead of a copy, please do so; it would be much appreciated.


Many Thanks,
Matt Friedman





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to