nerdexam
Zend

200-530 · Question #134

What is the output of the following code? 1 <?php 2 function append($str) 3 { 4 $str = $str.'append'; 5 } 7 function prepend(&$str) 8 { 9 $str = 'prepend'.$str; 10 } 12 $string = 'zce'; 13…

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

Question

What is the output of the following code? 1 <?php 2 function append($str) 3 { 4 $str = $str.'append'; 5 } 7 function prepend(&$str) 8 { 9 $str = 'prepend'.$str; 10 } 12 $string = 'zce'; 13 append(prepend($string)); 14 echo $string; 15 ?> Zend 200-530 Exam

Options

  • Azceappend
  • Bprependzceappend
  • Cprependzce
  • Dzce

How the community answered

(35 responses)
  • A
    14% (5)
  • B
    3% (1)
  • C
    74% (26)
  • D
    9% (3)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice