title: PHP: E_RECOVERABLE_ERROR: Instantiation of 'Closure' is not allowed?
body: <p>Hello unfortunatly I cannot find much information on this error on Google and I wonder what the problem is. I have an array containing a lot of information, including some closures (code example is shortened):</p>
  
  <pre><code>$create_info = array (
  'foo' =&gt; 'bar',
  'create_connection_object' =&gt; function ($my_key,$foreign_key) {
       return new ApConnection(intval($my_key), intval($foreign_key));
  },
  'hello' =&gt; 'world'
  );
  </code></pre>
  
  <p>Then I have a method using this array depending on the context:</p>
  
  <pre><code>$create_connection_object = $create_info['create_connection_object'];
  $con = new $create_connection_object(intval($request-&gt;first_id),intval($request-&gt;second_id));
  </code></pre>
  
  <p>When executing this code I get the following error:</p>
  
  <pre><code>"E_RECOVERABLE_ERROR: Instantiation of 'Closure' is not allowed"
  </code></pre>
  
  <p>In another context I got something working which looks quite similar (closure from array) and instantiated dynamically. Does anybody know a reason why this may fail?</p>