GetFunctionCalledName()

Returns the name of variable used to call the current function

GetFunctionCalledName( );

Returns: String

This function does not take any arguments.

Examples

yell = function (name){
     echo(name);
     dump(var=getFunctionCalledName(), label="Function was called as");
    };
<span class="nf">yell</span><span class="p">(</span><span class="s2">&quot;yell&quot;</span><span class="p">);</span>
<span class="nv">say</span> <span class="o">=</span> <span class="nv">yell</span><span class="p">;</span> <span class="c">// copy function</span>
<span class="nf">say</span><span class="p">(</span><span class="s2">&quot;say from &quot;</span><span class="p">);</span>
<span class="nv">yell</span> <span class="o">=</span> <span class="nv">say</span><span class="p">;</span> <span class="c">// copy function again</span>
<span class="nf">yell</span><span class="p">(</span><span class="s2">&quot;yell from say&quot;</span><span class="p">);</span>

See also