Jump to content

[SOLVED] simple noob question


Stickybomb

Recommended Posts

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,

Link to comment
https://forums.phpfreaks.com/topic/47622-solved-simple-noob-question/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.