nerdexam
Zend

200-710 · Question #94

What is the output of the following code? function increment (&$val) { return $val + 1; } $a = 1; echo increment ($a); echo increment ($a);

The correct answer is A. 22. See the full explanation below for the reasoning.

Functions

Question

What is the output of the following code? function increment (&$val) { return $val + 1; } $a = 1; echo increment ($a); echo increment ($a);

Options

  • A22

How the community answered

(23 responses)
  • A
    100% (23)

Topics

#pass by reference#return value#function output

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice