Garath531 Posted May 16, 2007 Share Posted May 16, 2007 I've seen the -> combination several times, but I have been unable to figure out what it means (mainly because Google doesn't read it). Can anybody tell me what it does? Quote Link to comment https://forums.phpfreaks.com/topic/51747-solved-php-what-does-that-mean/ Share on other sites More sharing options...
trq Posted May 16, 2007 Share Posted May 16, 2007 Its refers to an objects methods or properties. eg; $obj->foo(); Calls the foo() method belonging to the object referred to as $obj. Quote Link to comment https://forums.phpfreaks.com/topic/51747-solved-php-what-does-that-mean/#findComment-254900 Share on other sites More sharing options...
dj-kenpo Posted May 17, 2007 Share Posted May 17, 2007 ya I've been quietly confused on this as well, for the same reasons, still don't get it though. so it just calls the foo function? Quote Link to comment https://forums.phpfreaks.com/topic/51747-solved-php-what-does-that-mean/#findComment-255019 Share on other sites More sharing options...
cmgmyr Posted May 17, 2007 Share Posted May 17, 2007 pretty much. take a look at this: http://stilisticdev.net/tutorials.php?cmd=full&t=0017 that should give you a beginning idea about OOP Quote Link to comment https://forums.phpfreaks.com/topic/51747-solved-php-what-does-that-mean/#findComment-255035 Share on other sites More sharing options...
Garath531 Posted May 17, 2007 Author Share Posted May 17, 2007 Ahhhhh... I didn't know php could use O.O.P, just like Java, or C++. Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/51747-solved-php-what-does-that-mean/#findComment-255042 Share on other sites More sharing options...
Chesso Posted May 17, 2007 Share Posted May 17, 2007 Yeah, in alot of languages most properties or functions are accessed using ., rather than -> but it's the same thing. Like if you create a class, and a function within the class. Let's assume the class is called test_class and the function test_function. Also assuming the class is in the same document (for the purpose of simplcitiy) you could call the function like: test_class->test_function(); I came across this the other night, though I don't use classing myself, no need for it really, extra bloat when unnecessary but it has it's used. Quote Link to comment https://forums.phpfreaks.com/topic/51747-solved-php-what-does-that-mean/#findComment-255131 Share on other sites More sharing options...
Nameless12 Posted May 17, 2007 Share Posted May 17, 2007 I came across this the other night, though I don't use classing myself, no need for it really, extra bloat when unnecessary but it has it's used. Yes there is need for it because doing so actually reduces bloating significantly. Learn to become proficient in OOP before you dismiss it so easily. There are quite a lot of things you can do with OOP that make your code both smarter and less bloated that cannot be done in "Procedural". -> means "Points at" Quote Link to comment https://forums.phpfreaks.com/topic/51747-solved-php-what-does-that-mean/#findComment-255136 Share on other sites More sharing options...
cmgmyr Posted May 17, 2007 Share Posted May 17, 2007 Yes, OOP is very handy even if you only use it a little bit. If you make a database class...that would cut down on alot of programming for you. Quote Link to comment https://forums.phpfreaks.com/topic/51747-solved-php-what-does-that-mean/#findComment-255331 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.