#PHP
PHP
function f($v){foreach($GLOBALS as$n=>$x)$x!=$v?:die($n);}
if value is found, print variable name and exit. print nothing and don´t exit else.
61 bytes to return variable name or NULL
:
function f($v){foreach($GLOBALS as$n=>$x)if($x==$v)return$n;}
It will not find named functions, only those assigned to variables.
And a PHP function cannot detect wether a parameter was provided by reference or by value. The function will just return the first name where the value matches the function parameter value.