note 7925 added to Function arguments
| From: | almasy at axisdata dot com | Date: | Sun, 20 Aug 2000 20:11:13 +0000 |
| Subject: | note 7925 added to Function arguments | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-2797@lists.php.net to get a copy of this message | ||
Re: Passing By Reference Inside A Class
Passing arguments by reference does work inside a class. When you do:
$this->testVar = $ref;
inside setTestVar(), you're copying by value instead of copying by reference. I think what you
want there is this:
$this->testVar = &$ref;
Which is the new "assign by reference" syntax that was added in PHP4.
http://www.php.net/manual/functions.arguments.php