"$this" what type of object it is?

Answer Posted / kapil dhiman

<?php
class DemoTesting{

public $val="India is great";

public function checkThis()
{
//$this-> object of current class
echo $this->val;

}

}

$obj= new DemoTesting();
$obj->checkThis();
?>

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we override magic methods in php?

514


What are the difference between overloading and overriding in oops?

511


What is prepared statement in php?

564


What should we do to be able to export data into an excel file?

492


What is a null coalescing operator in php7?

699






How to access a Static Member of a Class in PHP?

488


Is php free to use?

508


Is php an object or array?

495


What are the php variables?

513


Is php faster than python?

539


Tell me what is the use of "enctype" attribute in a html form?

523


What are the popular frameworks in php?

506


What are the benefits of composer?

510


Does php class need constructor?

464


Which function is used to read a single character from a file in PHP.

538