note 10425 deleted from language.references.return by sniper
| From: | sniper@php.net | Date: | Tue, 30 Sep 2003 01:25:29 +0000 |
| Subject: | note 10425 deleted from language.references.return by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57348@lists.php.net to get a copy of this message | ||
Note Submitter: sam@liddicott.com
----
You might want to try
function &foo() {
$tmp=array(blah);
return &$tmp; '' or return %tmp;
}
$var=&foo();
I think trying to return an anonymous array (as you were) by reference won't work, also trying
to assign a reference to any array to elements of list won't work.
If you want to return an array of references you should make one, but how to assign an aarray of
references by reference to a list() structure I don't know.
My advice is to forget references in this case, and return by copy a list which contains either
references to scalars or actual objects or hashes. Then the list can be copied upon return but will
still refer to the real values.