Re: Objects: Cant set object variables with refrences ...
| From: | michael kimsal | Date: | Tue, 11 Feb 2003 13:13:44 +0000 |
| Subject: | Re: Objects: Cant set object variables with refrences ... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-135187@lists.php.net to get a copy of this message | ||
James wrote:
<snip>
However I would like refernce semantics and the final output of this script to be 1000. So I changed the line to "$this->t &= $c;" and suddenly I get the error: "Fatal error: Call to a member function on a non-object in /user/sh/jmb/Project/Wiki/Public_html/test.php on line 25" Anyone have any help on what is happening?$this->t = &$c; I dunno where &= comes from. I see people using it many times, but =& makes more sense imo. The & is 'by reference', and putting it explicitly in front of which variable is to be passed by reference *seems* more logical to me. Otherwise you could end up with $this->t &= $c.$d; What's being passed by reference at that point? Michael Kimsal http://www.phphelpdesk.com http://www.phpappserver.com 734-480-9961