开发者

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? I开发者_如何学Pythons it only intended to last as long as the session? Does it over ride the initial value of nameInObject?

Thanks


It will override any previous value.

It will only affect the current instance of the object.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜