note 6945 deleted from language.oop by victor
| From: | victor@php.net | Date: | Sat, 07 Dec 2002 15:41:20 +0000 |
| Subject: | note 6945 deleted from language.oop by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40472@lists.php.net to get a copy of this message | ||
"Why passing arguments by reference doesn't work within a class":
The problem lies not with the referenced argument but with the testVar member of the Test class.
This variable is NOT a reference so when you assign the parameter to it, it copies the string to it.
from a test i did .. you should simply change the setTestVar() function to this:
$this-testVar = &$ref;
NOTE: i'm pretty new to the PHP world and can't certify that what i say is right but it is
my assumption based on my experience with other programming languages.