Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.