title: PHP: passing a function with parameters as parameter
body: <p>I'm not sure that silly question, but I ask:<br />
  So, if there is an anonymous function I can give it as another anonymous functions parameter, if it has been already stored a variable.<br />
  But, whats in that case, if I have stored only one function in a variable, and add the second directly as a parameter into it? Can I add parameters to the non-stored function?</p>
  
  <p>Fist example (thats what i understand :) ):</p>
  
  <pre><code>$func = function($str){ return $str; };
  $func2 = function($str){ return $str; };
  $var = $func($func2('asd'));
  
  var_dump($var);
  // prints out string(3) "asd"
  </code></pre>
  
  <p>That makes sense for me, but what is with the following one?</p>
  
  <pre><code>$func = function($str){ return $str; };
  $var = $func(function($str = "asd"){ return $str; });
  
  var_dump($var);
  
  /** This prints out:
  object(Closure)#1 (1) {
    ["parameter"]=&gt;
    array(1) {
      ["$str"]=&gt;
      string(10) ""
    }
  }
  But why?
  */
  </code></pre>
  
  <p>And at the end, can someone recommend me a book or an article, from what i can learn this lambda coding feature of php?</p>