New Year Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmasmnth

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

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());

A.

No changes needed, the code would output 2 as is

B.

Line A, to: protected &$x = array();

C.

Line B, to: public function &getX() {

D.

Line C, to: return &$this->x;

E.

Line D, to: $a =& new A();

Zend 200-550 Summary

  • Vendor: Zend
  • Product: 200-550
  • Update on: Jan 2, 2026
  • Questions: 223
Price: $52.5  $149.99
Buy Now 200-550 PDF + Testing Engine Pack

Payments We Accept

Your purchase with ExamsVCE is safe and fast. Your products will be available for immediate download after your payment has been received.
The ExamsVCE website is protected by 256-bit SSL from McAfee, the leader in online security.

examsvce payment method