unable to identify the error while trying to access an array index
<p>The following php code :</p>

<pre><code>&lt;?php
class foo {
   $arr = array("First","Second","Third","Fourth");
}

$obj = new foo();
echo $obj-&gt;$arr[1];
?&gt;
</code></pre>

<hr>

<p>generates the following error : </p>

<pre><code>Parse error: syntax error, unexpected '$arr' (T_VARIABLE), expecting function (T_FUNCTION) in /opt/lampp/htdocs/tester.php on line 3
</code></pre>

<p>I am using php5.4 . What is this error ? How do I resolve this ?</p>
