"$this" what type of object it is?

Answers were Sorted based on User's Feedback



"$this" what type of object it is?..

Answer / venky

$this represents the current working class.
if you are accessing the variable or function with in the
same class then $this represents the current working object.
for ex:

class Test{

function fn_testing($a)
{
$a++;
return $a;

}
$c=$this->fn_tesing(1);
}

Is This Answer Correct ?    6 Yes 1 No

"$this" what type of object it is?..

Answer / 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

More PHP Interview Questions

How the web server interprets php and interacts with the client?

0 Answers  


how many type of url?

1 Answers  


How do you debug php?

0 Answers  


What are the rules to declare a php variables?

0 Answers  


Is php still in demand?

0 Answers  






Explain what does the expression exception::__tostring means?

0 Answers  


So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?

0 Answers  


Is false empty php?

0 Answers  


what is difference between edit and update?

1 Answers  


How to remove white spaces from the beginning and/or the end of a string in php?

0 Answers  


Do you know how to get the ip address of the client?

0 Answers  


How do we get the current session id?

0 Answers  


Categories