Re: note 9401 added to Classes and Objects
| From: | J. M. Castagnetto | Date: | Wed, 01 Nov 2000 20:20:36 +0000 |
| Subject: | Re: note 9401 added to Classes and Objects | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7249@lists.php.net to get a copy of this message | ||
--- eggbird@bigfoot.com wrote:
> i might be wrong here, but to me it seems that
> (within a method) something like this:
>
> $bla = "boink and $this->tuut";
This is because the parser is a little lenient w/ the
incorrect syntax in that line
>
> does work, but not this:
>
> $bla = "boink and $this->memberobject->tuut";
>
> I had to resort to
>
> $bla = "boink and ".$this->memberobject->tuut;
This is the correct way of doing concatenation, so
there is no ambiguity about the expression. Otherwise
it could mean:
"The property 'tuut' of the object
'$this->memberobject', or the property
'memberobject->tuut' of the object '$this'"
I presume that the first one is what you want. For
complex expressions, you should always use the
concatenation operator, see for example the "Variable
variables" section of the manual.
I will add a note explaining this point to your
contribution.
>
> in this case.
>
> http://www.php.net/manual/language.oop.php
>
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-notes-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-notes-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
=====
--- Jesus M. Castagnetto (jcastagnetto@yahoo.com)
__________________________________________________
Do You Yahoo!?
From homework help to love advice, Yahoo! Experts has your answer.
http://experts.yahoo.com/