title: Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in PHP 5.3
body: <p>I'm having a problem with this... it says "unexpected T_VARIABLE". The problematic line is this:</p>
  
  <p><code>$children[ $i['parent_id'] ][] = array($i['forum_id'], "&lt;option value=\"{$i['forum_id']}\"$selected&gt;  ", "{$i['forum_name']}&lt;/option&gt;\n");</code></p>
  
  <p>I tried removing the <code>$</code> (in <code>$children</code>), but it still results in error. It says "Parse error: syntax error, unexpected '[' in ..."</p>
  
  <p>Oddly, this works without problem in PHP 5.2. But in PHP 5.3, the problem appears.</p>
  
  <p>Since I'm not really a programmer (only know a little basic, I mostly design), I'm really clueless with what's going on here. Could anyone provide a help?</p>
  
  <p>Here is the complete function:</p>
  
  <pre><code>function build_forum_jump($html=1, $override=0, $remove_redirects=0)
  {
      global $INFO, $DB, $ibforums;
      $last_cat_id = -1;
  
      if ( $remove_redirects )
      {
          $qe = 'AND f.redirect_on &lt;&gt; 1';
      }
      else
      {
          $qe = '';
      }
  
      $DB-&gt;query("SELECT f.id as forum_id, f.parent_id, f.subwrap, f.sub_can_post, f.name as forum_name, f.position, f.redirect_on, f.read_perms, c.id as cat_id, c.name
                  FROM ibf_forums f
                   LEFT JOIN ibf_categories c ON (c.id=f.category)
                  WHERE c.state IN (1,2) $qe
                  ORDER BY c.position, f.position");
  
  
      if ($html == 1) {
  
          $the_html = "&lt;form onsubmit=\"if(document.jumpmenu.f.value == -1){return false;}\" action='{$ibforums-&gt;base_url}act=SF' method='get' name='jumpmenu'&gt;
                       &lt;input type='hidden' name='act' value='SF' /&gt;\n&lt;input type='hidden' name='s' value='{$ibforums-&gt;session_id}' /&gt;
                       &lt;select name='f' onchange=\"if(this.options[this.selectedIndex].value != -1){ document.jumpmenu.submit() }\" class='forminput'&gt;
                       &lt;optgroup label=\"{$ibforums-&gt;lang['sj_title']}\"&gt;
                        &lt;option value='sj_home'&gt;{$ibforums-&gt;lang['sj_home']}&lt;/option&gt;
                        &lt;option value='sj_search'&gt;{$ibforums-&gt;lang['sj_search']}&lt;/option&gt;
                        &lt;option value='sj_help'&gt;{$ibforums-&gt;lang['sj_help']}&lt;/option&gt;
                       &lt;/optgroup&gt;
                       &lt;optgroup label=\"{$ibforums-&gt;lang['forum_jump']}\"&gt;";
      }
  
      $forum_keys = array();
      $cat_keys   = array();
      $children   = array();
      $subs       = array();
      $subwrap    = array();
  
      // disable short mode if we're compiling a mod form
  
      if ($html == 0 or $override == 1)
      {
          $ibforums-&gt;vars['short_forum_jump'] = 0;
      }
  
      while ( $i = $DB-&gt;fetch_row() )
      {
          $selected = '';
          $redirect = "";
  
          if ($html == 1 or $override == 1)
          {
              if ($ibforums-&gt;input['f'] and $ibforums-&gt;input['f'] == $i['forum_id'])
              {
                  $selected = ' selected="selected"';
              }
          }
  
          if ( $i['redirect_on'] )
          {
              $redirect = $ibforums-&gt;lang['fj_redirect'];
          }
  
          if ($i['subwrap'] == 1)
          {
              $subwrap[ $i['forum_id'] ] = 1;
          }
  
          if ($i['subwrap'] == 1 and $i['sub_can_post'] != 1)
          {
          /***************************
          *** INFINITE SUBFORUMS 
          ****************************/
          if ($i['parent_id'] &gt; 0)    {
              $children[ $i['parent_id'] ][] = array($i['forum_id'], "&lt;option value=\"{$i['forum_id']}\"".$sub_css."$selected&gt;  ", "{$i['forum_name']}$is_sub&lt;/option&gt;\n");
          }
          else    {
              $forum_keys[ $i['cat_id'] ][$i['forum_id']] = "&lt;option value=\"{$i['forum_id']}\"".$sub_css."$selected&gt;  -{$i['forum_name']}$is_sub&lt;/option&gt;\n";
          }
          /**********INFINITE - END**************/
  
          }
          else
          {
              if ( $this-&gt;check_perms($i['read_perms']) == TRUE )
              {
                  if ($i['parent_id'] &gt; 0)
                  {
                  /***************************
                  *** INFINITE SUBFORUMS
                  ****************************/
                  $children[ $i['parent_id'] ][] = array($i['forum_id'], "&lt;option value=\"{$i['forum_id']}\"$selected&gt;  ", "{$i['forum_name']}&lt;/option&gt;\n");
                  /**********INFINITE - END**************/
                  }
                  else
                  {
                      $forum_keys[ $i['cat_id'] ][$i['forum_id']] = "&lt;option value=\"{$i['forum_id']}\"".$selected."&gt;&amp;nbsp;&amp;nbsp;- {$i['forum_name']} $redirect&lt;/option&gt;&lt;!--fx:{$i['forum_id']}--&gt;\n";
                  }
              }
              else
              {
                  continue;
              }
          }
  
          if ($last_cat_id != $i['cat_id'])
          {
  
              // Make sure cats with hidden forums are not shown in forum jump
  
              $cat_keys[ $i['cat_id'] ] = "&lt;option value='-1'&gt;{$i['name']}&lt;/option&gt;\n";
  
              $last_cat_id = $i['cat_id'];
  
          }
      }
  
      foreach($cat_keys as $cat_id =&gt; $cat_text)
      {
          if ( is_array( $forum_keys[$cat_id] ) &amp;&amp; count( $forum_keys[$cat_id] ) &gt; 0 )
          {
              $the_html .= $cat_text;
  
              foreach($forum_keys[$cat_id] as $idx =&gt; $forum_text)
              {
                  if ( $subwrap[$idx] != 1 )
                  {
                      $the_html .= $forum_text;
                  }
                  else if (count($children[$idx]) &gt; 0)
                  {
                      $the_html .= $forum_text;
  
                      if ($ibforums-&gt;vars['short_forum_jump'] != 1)
                      {
                          /****** INFINITE SUBFORUMS FIX BEGINS ************/
                          $the_html .= $this-&gt;subforums_addtoform($idx, \$children);
                          /********** INFINITE FIX - END ************/
                      }
                      else
                      {
                          $the_html = str_replace( "&lt;/option&gt;&lt;!--fx:$idx--&gt;", " (+".count($children[$idx])." {$ibforums-&gt;lang['fj_subforums']})&lt;/option&gt;", $the_html );
                      }
                  }
                  else
                  {
                      $the_html .= $forum_text;
                  }
              }
          }
      }
  
  
      if ($html == 1)
      {
          $the_html .= "&lt;/optgroup&gt;\n&lt;/select&gt;&amp;nbsp;&lt;input type='submit' value='{$ibforums-&gt;lang['jmp_go']}' class='forminput' /&gt;&lt;/form&gt;";
      }
  
      return $the_html;
  
  }
  </code></pre>