1

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

Ricalsin
  • 950
  • 9
  • 28

2 Answers2

2

It will override any previous value.

It will only affect the current instance of the object.

alex
  • 479,566
  • 201
  • 878
  • 984
1

Yes, you are assigning the value of someValue to the instance of nameInObject.

Yes, nameInObject will last only the lifetime of the variable this refers to; however, someValue will continue to live on.

Yes, you will override whatever value nameInObject contains with the value someValue contains.

Suroot
  • 4,315
  • 1
  • 22
  • 28