Please tell me what the result of this is and why? Thanks.
function f($x, $y) { $a = $x + 2; $x += 2; $y = 2 * $x; return ($x); }
$a = 1; $b = 2; $c = f($a, $b); print("result is $a, $b, $c, $x, $y \n");
$a and $b are not changed, so they remain 1 and 2. $c becomes equal to the $x in the function, which would be 3. $x and $y are unknown out of the function, so the are NULL.
what was this all about ???
Thanks. Checking that my lecture note was wrong as I thought! Stupid lecturer...