PrepAway - Latest Free Exam Questions & Answers

What is the output of the following code?

What is the output of the following code?
<code>
<code>
classtest {
public$value = 0;
functiontest() {
$this->value = 1;
} function __construct() {
$this->value = 2;
}}
$object = new test();
echo$object->value;
</code>

PrepAway - Latest Free Exam Questions & Answers

A.
2

B.
1

C.
0

D.
3

E.
No Output, PHP will generate an error message.


Leave a Reply

Your email address will not be published. Required fields are marked *