200-550 Web TestEngine demo

Exit VCEDump 200-550 Zend Certified PHP Engineer
Question 18 of 34
0% complete
Q18 Single choice

In the following code, which line should be changed so it outputs the number 2:

class A {
protected $x = array(); /* A */

public function getX() { /* B */
return $this->x; /* C */
}
}

$a = new A(); /* D */
array_push($a->getX(), "one");
array_push($a->getX(), "two");
echo count($a->getX());

Sign in to mark questions

Sign in to save marked questions and return to this demo.

Sign in