Fatal error when altering the user login form i want to customize login block in a fancy login box.

i used this code in a template.php

function bootstrap_form_user_login_block_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['name']['#size'] = 30;
  $form['pass']['#size'] = 30;
  $markup = l(t('Forgot your password?'), 'user/password', array('attributes' =&gt; array('title' =&gt; t('Request new password via e-mail.'))));
  if (variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)) {
    $markup .= ' ' . l(t('Sign up'), 'user/register', array('attributes' =&gt; array('title' =&gt; t('Create a new user account.'), 'class' =&gt; 'register-link')));
  }
  $markup = '&lt;div class="clearfix"&gt;' . $markup . '&lt;/div&gt;';
  $form['links']['#markup'] = $markup;
  $form['links']['#weight'] = 10000;
}


this code working fine, but on clicking singup link it giving error 


  Fatal error: [] operator not supported for strings in C:\xampp\htdocs\drupal\includes\common.inc on line 2445


How do I resolve it?
Looks like the problem is your class definition.

['attributes']['class'] should be an array but you are setting it as a string.

Your line:

$markup .= ' ' . l(t('Sign up'), 'user/register', array('attributes' =&gt; array('title' =&gt; t('Create a new user account.'), 'class' =&gt; 'register-link')));


Should be:

$markup .= ' ' . l(t('Sign up'), 'user/register', array('attributes' =&gt; array('title' =&gt; t('Create a new user account.'), 'class' =&gt; array('register-link'))));