Stickybomb Posted April 18, 2007 Share Posted April 18, 2007 I have been using php for a while now and as always am looking to delv more deepily into the language. Recently i have been looking into making some modifications to the phpbb forums software. However i ran into some code i have not seen before or rather used. Normaly i would just do a search but i am clueless to what i should search for. Basically they are using something like the following... this-> It appears to be passing something or storing something, but like i said not really sure what to look up information on. So if anyone could please point me in the right direction I would appriciate it. Thanks Sticky, Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted April 18, 2007 Share Posted April 18, 2007 Look up classes in the documentation. The this keyword is pretty standard for all OOP languages. Quote Link to comment Share on other sites More sharing options...
Stickybomb Posted April 19, 2007 Author Share Posted April 19, 2007 sorry just to be clear i am rerring to the symbol not the this -> i can find that be researching classes? Quote Link to comment Share on other sites More sharing options...
nikkieijpen Posted April 19, 2007 Share Posted April 19, 2007 $a->$b -> is a pointer to variable $b in class $a Quote Link to comment Share on other sites More sharing options...
redbullmarky Posted April 19, 2007 Share Posted April 19, 2007 it might not help your cause a great deal, but take a look anyway: http://www.phpfreaks.com/forums/index.php/topic,96282.0.html (sometimes knowing how to say it will help you figure out what it's for) nikkieijpen, $a->$b would reference the variable in object $a that has the name of the value of $b, rather than $b itself. $b = 'dog'; $a->$b is then pretty much the equivalent of writing $a->dog to reference the variable $b that belongs in object $a, you need $a->b . using $this is a way of referencing a function/variable from within the object itself. Quote Link to comment Share on other sites More sharing options...
Stickybomb Posted April 19, 2007 Author Share Posted April 19, 2007 thks redbull thats exactly what i was looking for Quote Link to comment 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.