What elements will be in the $a array after executing following code?
<?php
$a = array(1,2,3);
foreach ( $a as $key => &$value ) {
    $value = 1;
}
$value = 2;
?>
Explanation
Reference &$value saved after executing foreach.
PHP
PHP Quiz
Start Quiz

or Read more about PHP Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback