mallen Posted February 10, 2012 Share Posted February 10, 2012 I came across these pieces of code and have been trying to understand this operator -> Or if it is a operator. I have searched and couldn't find explanations. In trying to learn I need to know what is is used for. Is it used only with classes? $m->myMethod(); return $this->x; Quote Link to comment https://forums.phpfreaks.com/topic/256779-what-are-these-operators/ Share on other sites More sharing options...
Adam Posted February 10, 2012 Share Posted February 10, 2012 It's called the "object operator", and allows you to access methods and properties within an object. Be careful to note the difference between a class and an object here though. I would suggest reading the manual's introduction to them: http://www.php.net/manual/en/language.oop5.basic.php Quote Link to comment https://forums.phpfreaks.com/topic/256779-what-are-these-operators/#findComment-1316375 Share on other sites More sharing options...
mallen Posted February 10, 2012 Author Share Posted February 10, 2012 Perfect, thank you. Now that I know what they are called I can read up on them. Quote Link to comment https://forums.phpfreaks.com/topic/256779-what-are-these-operators/#findComment-1316377 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.