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());
Nu
12 hours agoKarima
6 days agoPearly
11 days agoLashanda
16 days agoMerrilee
21 days agoNaomi
27 days agoNoelia
1 month agoHelene
1 month agoOsvaldo
1 month agoFlorinda
2 months agoFrankie
2 months agoJulene
2 months ago