title: Define and execute function inside php array
body: <p>How To define and execute a  function inside array</p>
  
  <p>for example i have a array</p>
  
  <pre><code>    $a="a";
      $b="b";
      $c="c"; 
      $array=array(
           "a"=&gt;$a,
           "b"=&gt;$b,
           "c"=&gt;function($c){
                  //do something 
                return output
            }      
      )
  </code></pre>
  
  <p>here output should be </p>
  
  <pre><code>Array
  (
      [a] =&gt; a
      [b] =&gt; b
      [c] =&gt; "new value of c"
  
  )
  </code></pre>
  
  <p>but actually  i am getting</p>
  
  <pre><code>Array
  (
      [a] =&gt; a
      [b] =&gt; b
      [c] =&gt; Closure Object
          (
              [parameter] =&gt; Array
                  (
                      [$c] =&gt; 
                  )    
          )    
  )
  </code></pre>
  
  <p>NB: i can define a function outside this and call that function inside but i dont want to do that</p>