200-550試験無料問題集「Zend-Technologies Zend Certified PHP Engineer 認定」
CORRECT TEXT
What is the output of the following code?
function increment (&$val)
{
return $val + 1; }
$a = 1;
echo increment ($a); echo increment ($a);
What is the output of the following code?
function increment (&$val)
{
return $val + 1; }
$a = 1;
echo increment ($a); echo increment ($a);
正解:
22
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());
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());
正解:D
解答を投票する