MCQs > IT & Programming > PHP > What is output? printName('James'); ?>

PHP MCQs

What will be the output of executing the following code? <?php class Foo { private function printName($name) { print_r($name); } } $a = new Foo(); $a->printName('James'); ?>

Answer

Correct Answer: Fatal error: Call to private method Foo::printName() from context ...

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it