Sorry if the title implies that I have a problem that needs solving. The title was meant to imply that I think PHP may have a 'problem' (or at least a shortcoming) with references.
I am currently in the detailed design phase of a project. There are many possible ways to do things. One of the possible designs relies on object references being returned in a function parameter, it would appear that you can return anything in a function parameter EXCEPT a reference to an object. So I will drop that particular alternative! I was just seeking clarification that this was the case or whether I had just overlooked some function (e.g. dereference($Ref) =& $Object). As for the bizarre function, well that was just an illustration of what I meant. It indicates that I can't just return copies of objects (which would be the default case) because the returned sub-object would not be related to the returned main object. Thanks for the tip about returning arrays. I think that's where the final design lies :) "David Otton" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 4 Dec 2003 09:58:09 -0800, you wrote: > > >David Otton <[EMAIL PROTECTED]> > > on Thursday, December 04, 2003 3:43 AM said: > > > >> function f() > >> { > >> return (array (7, 5)); > >> } > >> > >> list ($a, $b) = f(); > > > >Hey cool! I never knew about that. > > Yeah, compared with returning a pointer to an array of pointers to > structs... well, scripting languages make you lazy :) > > But without some feedback, I have no idea whether it solved his problem or > not :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php