title: PHP - warning - Undefined property: stdClass - fix?
body: <p>I get this warning in my error logs and wanted to know how to correct this issues in my code.</p>
  
  <p>Warning:
  PHP Notice:  Undefined property:  stdClass::$records in script.php on line 440</p>
  
  <p>Some Code:</p>
  
  <pre><code>// Parse object to get account id's
  // The response doesn't have the records attribute sometimes.
  $role_arr = getRole($response-&gt;records);  // Line 440 
  </code></pre>
  
  <p>Response if records exists</p>
  
  <pre><code>stdClass Object
  (
      [done] =&gt; 1
      [queryLocator] =&gt;
      [records] =&gt; Array
          (
              [0] =&gt; stdClass Object
                  (
                      [type] =&gt; User
                      [Id] =&gt;
                      [any] =&gt; stdClass Object
                          (
                              [type] =&gt; My Role
                              [Id] =&gt;
                              [any] =&gt; &lt;sf:Name&gt;My Name&lt;/sf:Name&gt;
                          )
  
                  )
  
          )
  
      [size] =&gt; 1
  )
  </code></pre>
  
  <p>Response if records does not exist</p>
  
  <pre><code>stdClass Object
  (
      [done] =&gt; 1
      [queryLocator] =&gt;
      [size] =&gt; 0
  )
  </code></pre>
  
  <p>I was thinking something like array_key_exists() functionality but for objects, anything? or am I going about this the wrong way?</p>