krusmal Posted November 26, 2009 Share Posted November 26, 2009 Hi, I am new to PHP and am trying my hands on Object Oriented PHP. I need a little help on the symbol -> I know how to use -> symbol. But I have seen some typical examples of it which I dont understand. Please check the following example and somebody tell me what actually it all means and what class structure it is used for: Example::instance()->foo()->bar()->get()->something(); Please tell me the meaning of the multiple -> symbols in a single statement. I hope it is not a silly question. Link to comment https://forums.phpfreaks.com/topic/183033-what-does-mean/ Share on other sites More sharing options...
dgoosens Posted November 26, 2009 Share Posted November 26, 2009 Example::instance()->foo()->bar()->get()->something(); well, to put it simply it is "short" for this: $example = Example::instance(); $foo = $example->foo(); $bar = $foo->bar(); $get = $bar->get(); $something = $get->something(); Link to comment https://forums.phpfreaks.com/topic/183033-what-does-mean/#findComment-965991 Share on other sites More sharing options...
krusmal Posted November 26, 2009 Author Share Posted November 26, 2009 Oh I see. Was it not simple? Thanks Friend. You helped a lot. I am also new to this forum and the captcha sucks..... Link to comment https://forums.phpfreaks.com/topic/183033-what-does-mean/#findComment-966011 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.