Error when developing forms Fatal error: Cannot use string offset as an array form.inc on line 985

In my case the error Fatal error: Cannot use string offset as an array form.inc on line 985, was caused by a missing declaration of the form array.

<?php
   $form
= array(); //If this is not present it will cause the fatal error

  
$form['logs']['copy'] = array(
     
'#type' => 'checkbox',
      
'#return_value' => 1,
      
'#default_value' => 0,
     
'#title' => t('Delete all logs for this account.'),
    );

   
$form['logs']['account'] = array(
     
'#type' => 'hidden',
     
'#value' => $account_name,
    );

    
$form['logs']['submit'] = array(
   
'#type' => 'submit',
   
'#title' => 'Delete',
   
'#submit' => array('support_filter_delete_logs_form_submit'),
   
'#value' => t("Delete"),
   
'#weight' => 3,
  );

  return
$form;
?>
Knowledge keywords: