"Cannot use string offset as an array" I am theming a node for a specific content type and split the theme into whether the node is being displayed as a teaser or full. This error only comes up when you view the full node. 


  Error: Cannot use string offset as an array in XXXXXX/node--event.tpl.php on line 100


The node displays fine as a teaser, which makes this error even more confusing as the problematic line is used during teaser display. The code below is the one for the teaser part of the template.

  &lt;?php if ($teaser): ?&gt;
  &lt;div id="node-&lt;?php print $node-&gt;nid; ?&gt;" class="&lt;?php print $classes; ?&gt; clearfix"&lt;?php print $attributes; ?&gt;&gt;

        &lt;h2&lt;?php print $title_attributes; ?&gt;&gt;
      &lt;a href="&lt;?php print $node_url; ?&gt;"&gt;&lt;?php print $title; ?&gt; - 

        &lt;span class="eventdate"&gt;&lt;?php print(substr($node-&gt;field_date[und][0][value], 0, -9));?&gt;&lt;/span&gt;
        &lt;/a&gt;&lt;/h2&gt;
  &lt;div class="content clearfix"&lt;?php print $content_attributes; ?&gt;&gt;
     &lt;?php
      // We hide the comments and links now so that we can render them later.
      hide($content['comments']);
      hide($content['links']);
      //*********LINE100**************
print($node-&gt;body[und][0][safe_value]);
    ?&gt;
  &lt;/div&gt;

    &lt;div class="link-wrapper"&gt;
      &lt;?php print $links; ?&gt;
    &lt;/div&gt;
    &lt;/div&gt;
  &lt;?php endif; ?&gt;
If you get that error, it means that $node-&gt;body is not an array, but a string. In that case, PHP would take $node-&gt;body[und] as a string offset, and you could not use $node-&gt;body[und][0][safe_value].

To notice that both und, and safe_value are considered from PHP two constants, but Drupal doesn't define those constants. In that case, PHP would use as value of the constants und, and safe_value, the values of the strings 'und', and 'safe_value', but you should not rely on that.