title: How do I pass multiple arguments to an anonymous function in PHP?
body: <p>PHP 5.3+ supports <a href="http://php.net/manual/en/functions.anonymous.php" rel="nofollow noreferrer">anonymous functions</a> (although, it supports them a tad bit differently in PHP 7.x+ in terms of binding). I am running PHP 5.6.x</p>
  
  <p>Is there a syntax that allows for <em>multiple arguments</em> to be passed to an anonymous function (without resorting to using just an array) <em>being used as a <strong>callback</em></strong>. Which of these examples, if any, are possible in PHP?</p>
  
  <p><strong>Example 1</strong></p>
  
  <pre><code>function ($str1, $str2 ){   //But, that would be too easy, right?
      return $str1 . $str2;
  }
  </code></pre>
  
  <p><strong>Example 2</strong></p>
  
  <pre><code>function () use ($string, $min, $max) {  // Not seeing this in the manual.
      $length = mb_strlen($string, 'UTF-8');
      return ($length &gt;= $min) &amp;&amp; ($length &lt;= $max);
  }
  </code></pre>
  
  <p><strong>Example 3</strong></p>
  
  <p>Just out of curiosity, is this form possible?</p>
  
  <pre><code>function ($str1, $str2 ) use ($int1, $int2) { // But, that would be in the manual?
      return $str1 . $str2 .' '. $int2 + $int2;
  }
  </code></pre>
  
  <p>I looked in the PHP manual, but didn't see what I was looking for.</p>