PrepAway - Latest Free Exam Questions & Answers

What will the $array array contain at the end of this script?

What will the $array array contain at the end of this script?
<code>
1 <?php
2 function modifyArray (&$array)
3 {
4 foreach ($array as &$value)
5 {
6 $value = $value + 1;
7 }
8
9 $value = $value + 2;
10 }
11
12 $array = array (1, 2, 3);
13 modifyArray($array);
14 ?>
</code>

PrepAway - Latest Free Exam Questions & Answers

A.
2, 3, 4

B.
2, 3, 6

C.
4, 5, 6

D.
1, 2, 3

One Comment on “What will the $array array contain at the end of this script?


Leave a Reply

Your email address will not be published. Required fields are marked *