"$this" what type of object it is?
Answers were Sorted based on User's Feedback
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 |
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 |
Why php 7 is faster?
Do you know what is use of count() function in php?
Does wordpress still use php?
List some features of php that are deprecated in php
What is the difference between the functions unlink and unset?
Is it easy to learn wordpress?
What is the ioncube php loader?
How can we set and destroy the cookie in php?
Define soundex()?
What is the use of Mbstring?
List some features of php that are deprecated in php7?
How can I execute a PHP script using command line?