MCQs > IT & Programming > PHP 5 > interface ExampleInterface { } class ExampleClass implements Exampleinterface { } $x = new ExampleClass; $y = new ExampleClass; $z = $p = 'NotExampleClass'; var_dump($x instanceof $y); var_dump($x instanceof $z); var_dump($x instanceof $p); ?>

PHP 5 MCQs

Which of the given statements is correct about the following PHP 7.1 code?

interface ExampleInterface

{

}

class ExampleClass implements Exampleinterface

{

}

$x = new ExampleClass;

$y = new ExampleClass;

$z = $p = 'NotExampleClass';

var_dump($x instanceof $y);

var_dump($x instanceof $z);

var_dump($x instanceof $p);

?>

Answer

Correct Answer:

The code will compile successfully and will print the following output:

bool(true)

bool(true)

bool(false)


Explanation:

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

PHP 5 Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP 5 Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it