Why can't I access the array with index directly?
<p>I got confused when I was trying to access an array element directly with its index. I guess I could explain it better in coding:-</p>

<p>I am having an object of Employee Class and I TypeCast it to array and tried to display it like this:</p>

<pre><code>$arrOfObj = (array) $objEmployee;

$arrKeys = array_keys( $arrOfObj );

display( $arrOfObj ); // display() is a method in my library that prints an array in a mannered way.
</code></pre>

<p>this gives me the following output :-</p>

<pre><code>Array
(
   [*m_UserId] =&gt; 1155
   [*m_EmailPassword] =&gt; 
   [*m_IsAssignedToManagementCompany] =&gt; 
   [*m_ManagementCompanyId] =&gt; 
   [*m_DepartmentId] =&gt; 3
   [*m_DesignationId] =&gt; 4
   [*m_EmployeeCompletedMonth] =&gt; 
   [*m_EmployeeCompletedDay] =&gt; 
   [*m_EmailAddress] =&gt;showket.mca@gmail.com
   ------
   ------
 )
</code></pre>

<p>Now here I dont understand this Star(*). when my member variables are simple like m_UserId, m_EmialPassword and So on where from it gets this Star. and when I try to display the same with following 2 statements I got an error :- </p>

<pre><code>display( $arrOfObj['*m_EmailAddress'] );
</code></pre>

<p><strong>or</strong> </p>

<pre><code>display( $arrOfObj['m_EmailAddress'] );
</code></pre>

<p>Both give the Error message <strong>Undefined index: m_EmailAddress</strong></p>

<p>And when i try to do it this way It works fine :-</p>

<pre><code>display( $arrOfObj[$arrKeys[8]] );
</code></pre>

<p>The last one works fine, Can anyone explain me the problem.</p>

<pre><code>            display( $arrOfObj[$arrKeys[11]] );
            display( $arrOfObj['m_strEmailAddress'] );
</code></pre>
