开发者

What's the difference between this two PHP object instantiation types?

I wonder about the differences of this PHP instantiation type.

$object = new MyClass();

开发者_开发技巧

vs

$this->object = new MyClass();

What's the difference between this two?


The first one instantiates an object of MyClass to a variable object in variable-scope.

The second one instantiates an object of MyClass in another(not necessarily a different one) class object attributes value.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜