RE: [PHP] What is "->" mean in php?
| From: | Kearns, Terry | Date: | Fri, 08 Mar 2002 00:27:57 +0000 |
| Subject: | RE: [PHP] What is "->" mean in php? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-87714@lists.php.net to get a copy of this message | ||
Because I'm not a hacker on the PHP engine, I don't really know but I also
saw this symbol when learning C++ recently. It is used in C++ as a shortcut
to dereferencing and accessing an objects properties/methods on objects
which are on the free store (heap). Normally C++ uses the dot operator to
access methods/properties (eg. "foo.do()"), but when the object needs to
first be dereferenced, then "foo->do()" can be used as a shortcut to
"(*foo).do()".
Of course, this doesn't help you at all does it :) But I thought it was an
interesting connection to C++ and maybe hints at how PHP internally manages
objects. Perhaps it's just a coincidence.
[TK]
> -----Original Message-----
> From: S.Murali Krishna [mailto:smk_bk@yahoo.com]
> Sent: Monday, 4 March 2002 9:48 PM
> To: Jack
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] What is "->" mean in php?
>
>
>
> If you have any Object Oriented Programming experience, then
> you may not had asked this. Its a operator to access methods,
> and variables inside a instance of a class , in which the
> variable before "->" is the instance of the class and the
> latter is a method or variable of that class. This is what I
> know, if you have any explanatory docs, pls let me know.
>
>
>
> On Mon, 4 Mar 2002, Jack wrote:
>
> > Dear all
> > There is one symbol in PHP that i always see is "->", could
> anyone pls
> > tell me what is this, and what does that do? Here is the
> statement i
> > saw could some pls explain what it means?
> >
> > if (!empty($row->usd_period)
> >
> > Thx a lot
> > Jack
> > jack@nedcor.com
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> <smk_bk@yahoo.com>
> -------------------------------------------------------------------
> We must use time wisely and forever realize that the time is
> always ripe to do right."
>
> -- Nelson Mandela
> -------------------------------------------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>