DWQA QuestionsWhat is the purpose of returning $this in PHP?
admin_alan4v3v Staff asked 2 years ago

$this is in particular used to refer houses of a category. It is the way to reference an instance of a category from inside itself, similar to many other object orientated languages. From the PHP docs: The pseudo-variable $this is to be had when a method is referred to as from inside an item context.

$this indicates the contemporary objectthe only the technique is presently being run on. By returning $this a connection with the object the method is working gets sent back to the calling function.