note 7925 deleted from functions.arguments by cmb
| From: | cmb@php.net | Date: | Tue, 26 Apr 2016 16:47:57 +0000 |
| Subject: | note 7925 deleted from functions.arguments by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-205341@lists.php.net to get a copy of this message | ||
Note Submitter: almasy at axisdata dot com
----
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.