RE: [PHP-DEV] Class related mayhem...
| From: | Stanislav Malyshev | Date: | Mon, 06 Nov 2000 12:45:50 +0000 |
| Subject: | RE: [PHP-DEV] Class related mayhem... | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-37260@lists.php.net to get a copy of this message | ||
JP>> That said, is there any way of just passing a reference, rather
JP>> than a copy of the userData array itself, or am I being too 'C'
JP>> ?
Yes, you can declare your function as accepting args by reference
(function foo(&$var) { ) and thus get the value by reference. But - don't
use this in the constructor, since $this in the constructor and the later
object can be different (this is going probably to be fixed, but not
that's how it is). I.e., it's better to do after constructor has been
finished. Also, remember that references are not the same as C pointers
and have a lot of "interesting" properties - read "References explained"
in the manual.
--
Stanislav Malyshev, Zend Products Engineer
stas@zend.com http://www.zend.com/ +972-3-6139665 ext.106