On Thu, 9 Oct 2003 22:50:10 +0200, Esctoday.Com | Wouter Van Vliet <[EMAIL PROTECTED]> wrote:

Thanks Curt.

This solution works indeed. BUT, there's one but. Isn't there a way to not
have to tell PHP that I want the return of $this->AddFoo() as a reference?
In the actual code I want to worry as little as possible about specific
things like this. Isn't it a little strange that you have to both let php
know it's returning a reference as well as let it know that it's expecting a
reference as return value?



well you do need to worry about it somewhere, and i would think that the function
declaration:
function &AddFoo()


Would take care of this, but I think there is some strange things going on with the
class. IIRC, issuing a


$foo = $bar->AddFoo();

Doesn't return a reference.


Hopefully someone here can mabey give some more insite as to why there has to be both the declaration and the call references.


  function &AddFoo()
 -and-
  $foo = &$bar->AddFoo();


Curt.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to