What will be the output of the following PHP 7.1 code?
class First
{
private $foo = 2;
protected $bar = 4;
protected function A_funct()
{
return 5;
}
public function B_funct()
{
return new class($this->foo) extends First {
private $test;
public function _construct($foo)
{
$this->test = $foo;
}
public function C_funct()
{
return $this->bar + $this->test + $this->A_funct();
}
};
}
}
echo (new First)->B_funct()->C_funct();?>
Correct Answer:
11
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More PHP 5 MCQ Questions