<?php
$a = 3;
$b = &$a;
echo 'B = '.$b."\n";
$b = 2;
echo 'A = '.$a."\n";
$a = 5;
echo 'B = '.$b."\n";
function links(&$var){
$var = 1;
global $a;
$a = 3;
echo 'GLOBAL A = '.$a."\n";
echo 'VAR = '.$var."\n";
return $var+1;
}
$a = links($a);
echo 'B = '.$b."\n";
echo 'A = '.$a."\n";
PD9waHAKJGEgPSAzOwokYiA9ICYkYTsKZWNobyAnQiA9ICcuJGIuIlxuIjsKJGIgPSAyOwplY2hvICdBID0gJy4kYS4iXG4iOwokYSA9IDU7CmVjaG8gJ0IgPSAnLiRiLiJcbiI7CgpmdW5jdGlvbiBsaW5rcygmJHZhcil7CiAgJHZhciA9IDE7CiAgZ2xvYmFsICRhOwogICRhID0gMzsKICBlY2hvICdHTE9CQUwgQSA9ICcuJGEuIlxuIjsKICBlY2hvICdWQVIgPSAnLiR2YXIuIlxuIjsKICByZXR1cm4gJHZhcisxOwp9CgokYSA9IGxpbmtzKCRhKTsKZWNobyAnQiA9ICcuJGIuIlxuIjsKZWNobyAnQSA9ICcuJGEuIlxuIjsK