Zend Certified PHP Engineer 200-550 Question # 43 Topic 5 Discussion

Zend Certified PHP Engineer 200-550 Question # 43 Topic 5 Discussion

200-550 Exam Topic 5 Question 43 Discussion:
Question #: 43
Topic #: 5

What is the output of the following code?

class C {

public $x = 1;

function __construct() { ++$this->x; }

function __invoke() { return ++$this->x; }

function __toString() { return (string) --$this->x; }

}

$obj = new C();

echo $obj();


A.

0


B.

1


C.

2


D.

3


Get Premium 200-550 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.