Just a quick question....
View Single Post
08-19-2008, 06:23 PM
Join Date: Aug 2008
Location: Haworth, West Yorkshire
"$this" is a pseudo variable used within a class to refer to the class itself. Obviously, since the object hasn't been instantiated yet, we can't use it within the class.
say I have an object $foo
and a property $bar, I can now call that property
BUT, within the class code, I don't know I'm going to call the object "$foo", so "$this" is used as a generic reference to the object
I'm just getting my head round classes myself, so I hope that helps
View Public Profile
Send a private message to adamsargant
Find More Posts by adamsargant