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());
Joaquin
11 hours agoNu
2 months agoKarima
2 months agoPearly
2 months agoLashanda
2 months agoMerrilee
2 months agoNaomi
2 months agoNoelia
3 months agoHelene
3 months agoOsvaldo
3 months agoFlorinda
3 months agoFrankie
3 months agoJulene
3 months ago