title: Illegal string offset when using string to reference array
body: <p>I have classes, each with a date related member variable that always has the same naming format - <code>field_{$node-&gt;type}_date</code></p>
  
  <p>For example, if I my node type was 'car', the date field would be named <code>field_car_date</code></p>
  
  <p>So I am looping over all my nodes and I want to access the date related field for each of them. However I am getting an error. Here's the code</p>
  
  <pre><code>$date_field_key = 'field_' . $node-&gt;type . '_date';
  if (isset($node-&gt;$date_field_key['und'][0]['value'])) {
  </code></pre>
  
  <p>I get an error because of the second line. The error is - <code>Illegal string offset 'und'</code>
  The date related variable is an array and it does have an element with the key 'und'. If I write out the line explicitly - <code>$node-&gt;field_car_date['und'][0]['value']</code> - it works fine. It's just when I dynamically create the field name that I get this problem.</p>
  
  <p>Any solution for this, is my syntax incorrect?</p>