Is it possible to create an associative array which holds instances of a custom class?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2702863/initializing-php-class-property-declarations-with-simple-expressions-yields-synt">Initializing PHP class property declarations with simple expressions yields syntax error</a>  </p>
</blockquote>



<p>Is it possible to create an associative array and parse instances of a custom class as values?</p>

<p>Something like:</p>

<pre><code> private static $contentTypeList = array(
    "News" =&gt; new ContentType("News", "news.php", "News"),
    "Termine" =&gt; new ContentType("Termine", "termine.php", "Termine"),
    "Zeitplan" =&gt; new ContentType("Zeitplan", "zeitplan.php", "Zeitplan"),
    "Fotos" =&gt; new ContentType("Fotos", "fotos.php", "Fotos"),
    "Anfahrt" =&gt; new ContentType("Anfahrt", "anfahrt.php", "Anfahrt"),
    "Guestbook" =&gt; new ContentType("Guestbook", "guestbook.php", "G&amp;auml;stebuch")
    );
</code></pre>

<p>Trying this I'm getting an error like "unexpected keyword NEW".</p>

<p>Do I use the wrong syntax or is it just not possible?</p>
