title: Getting Undefined property: stdClass::$options when using a foreach on an array
body: <p>I have an PHP object - $new_step. </p>
  
  <p>In Laravel, if I dd on a child object that is an array - <code>dd($new_step-&gt;data-&gt;options);</code> - of it, I get a valid entry:</p>
  
  <pre><code>array:5 [▼
    0 =&gt; {#695 ▼
      +"position": 1
      +"value": "Dogs"
    }
    1 =&gt; {#694 ▼
      +"position": 2
      +"value": "Cats"
    }
    2 =&gt; {#693 ▼
      +"position": 3
      +"value": "Ferretts"
    }
    3 =&gt; {#669 ▼
      +"position": 4
      +"value": "Gophers"
    }
    4 =&gt; {#665 ▼
      +"position": 5
      +"value": "Possum"
    }
  ]
  </code></pre>
  
  <p>However, when I try to do a foreach on the object:</p>
  
  <pre><code>        foreach ($new_step-&gt;data-&gt;options as $options) {
              $options-&gt;count = 0;
          }
  </code></pre>
  
  <p>I get this error: </p>
  
  <pre><code>ErrorException
  Undefined property: stdClass::$options
  </code></pre>
  
  <p>Why does the foreach fail?</p>