What do the -> symbols do?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
itsmarkk
Forum Newbie
Posts: 2
Joined: Sat Jan 14, 2012 1:21 pm

What do the -> symbols do?

Post by itsmarkk »

I am very new to PHP programming. In the following code snippet from a smtp.php file, what does the " -> " do? Does is have a functional meaning? Or is it just part of a variable name?

if(!isset($this->status)){
$obj = new smtp($params);
if($obj->connect()){
$obj->status = SMTP_STATUS_CONNECTED;
}


Thanks in advanced!
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: What do the -> symbols do?

Post by Celauran »

They allow you to access an object's properties and methods.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: What do the -> symbols do?

Post by Eric! »

Perhaps a tutorial with some videos might help? I haven't looked at these but hopefully it will take you in the right direction!

http://www.killerphp.com/tutorials/object-oriented-php/
itsmarkk
Forum Newbie
Posts: 2
Joined: Sat Jan 14, 2012 1:21 pm

Re: What do the -> symbols do?

Post by itsmarkk »

Thanks for the quick replies!
Post Reply