nerdexam
Zend

200-550 · Question #58

What is the output of the following code? function append($str) { $str = $str.'append'; } function prepend(&$str) { $str = 'prepend'.$str; } $string = 'zce'; append(prepend($string)); echo $string;

The correct answer is C. prependzce. See the full explanation below for the reasoning.

Question

What is the output of the following code? function append($str) { $str = $str.'append'; } function prepend(&$str) { $str = 'prepend'.$str; } $string = 'zce'; append(prepend($string)); echo $string;

Options

  • Azceappend
  • Bprependzceappend
  • Cprependzce
  • Dzce

How the community answered

(22 responses)
  • A
    5% (1)
  • B
    9% (2)
  • C
    82% (18)
  • D
    5% (1)

Community Discussion

No community discussion yet for this question.

Full 200-550 Practice