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)- A5% (1)
- B9% (2)
- C82% (18)
- D5% (1)
Community Discussion
No community discussion yet for this question.