title: PHP, is_array() generating an "Undefined property: stdClass::$crit " error
body: <p><code>is_array($src2-&gt;crit)</code> is generating an "Undefined property: stdClass::$crit" error.</p>
  
  <p>The line throwing the error is:
  <code>if(is_array($src2-&gt;crit) &amp;&amp; count($src-&gt;crit) &gt; 0){</code></p>
  
  <p><code>$src2-&gt;crit</code> is initialized here.</p>
  
  <pre><code>$src2-&gt;crit = array();
   $src2-&gt;crit[0] = new dataSet();
   $src2-&gt;crit[0]-&gt;tblName = $tbl2;
   $src2-&gt;crit[0]-&gt;colName = "ID";
   $src2-&gt;crit[0]-&gt;val = $elm-&gt;editID;
  </code></pre>
  
  <p>When testing <code>$src2-&gt;crit</code> with this code.</p>
  
  <pre><code>print("\$src-&gt;crit is a ".$src-&gt;crit."&lt;br /&gt;");
  print_r($src-&gt;crit); print("&lt;br /&gt;");
  </code></pre>
  
  <p>This is returned.</p>
  
  <pre><code>$src2-&gt;crit is a Array
  Array ( [0] =&gt; dataSet Object ( [tblName] =&gt; sExam [colName] =&gt; ID [val] =&gt; 10 ) )
  </code></pre>
  
  <p>What am I not seeing/understanding correctly? If <code>print("\$src2-&gt;crit is a ".$src-&gt;crit."&lt;br /&gt;")</code> returns that it is an array then why is <code>is_array($src2-&gt;$crit)</code> generating an error? </p>