title: Function literal in PHP class
body: <p>Take a look at this code, please:</p>
  
  <pre><code>$array = array(
      'action' =&gt; function () { echo "this works"; }
  );
  
  class Test {
      public $array = array(
          "action" =&gt; function () { echo "this doesn't"; }
      );
  }
  </code></pre>
  
  <p>The first function literal parses fine, but the second - the one inside the class - triggers a syntax error:</p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected 'function' (T_FUNCTION)...</p>
  </blockquote>
  
  <p>Can somebody explain this to me? Is this a bug?</p>
  
  <p>EDIT: This is the latest PHP: 5.6.6</p>