Search code examples
oopnomenclature

OOP theory question :: $this->someVariable = $someValue


I was wondering what this statement actually does:

$this->nameInObject = $someValue;

So if you're inside a class object that has a variable "nameInObject", are you assigning a value of someValue to that instance of nameInObject? Is it only intended to last as long as the session? Does it over ride the initial value of nameInObject?

Thanks


Solution

  • It will override any previous value.

    It will only affect the current instance of the object.