<?php
$var3 = 1;
$var4 = 2;
function test2(){
global $var3,$var4;
$var4 = &$var3;
$var4 = 3;
//$var3 = 3;
}
test2();
echo $var4 ;
?>
question 1: why does $var4 still output 2 here? it doesn"t work to re-assign values to $var3 or $var4 later. My understanding is that $var3 passes references and values to $var4, in the function, so $vars4 should point to the same address as $var3.
question 2: please recommend a book suitable for PHPer. I prefer to focus on the above books on the principles of PHP. Thank you.