I'm just trying to understand passing by reference in PHP by trying some examples found on php.net. I have one example right here found on the php website but it does not work:
function foo(&$var)
{
return $var++;
}
$a=5;
echo foo($a); // Am I not supposed to get 6 here? but I still get 5
This is an example found here
Can anybody tell me why am I getting 5 instead of 6 for the variable $a?