Drupal 7自定义表单无法将字符串偏移量用作PHP7.2中的数组错误

Drupal 7自定义表单无法将字符串偏移量用作PHP7.2中的数组错误,php,drupal-7,php-7.2,Php,Drupal 7,Php 7.2,我有一个定制的Drupal7表单,如下所示 $form['general_details'] = array( '#type' => 'fieldset', '#title' => t('General'), '#description' => t('General Information.'), '#required' => TRUE, ); $form['gener

我有一个定制的Drupal7表单,如下所示

   $form['general_details'] = array(
         '#type' => 'fieldset',
         '#title' => t('General'),
         '#description' => t('General Information.'),
         '#required' => TRUE,
         );

   $form['general_details']['salutation'] = array(
         '#type' => 'select',....
我在“$form['general_details']['saltation']行中遇到错误错误:无法将字符串偏移量用作PHP7.2的数组

有人能帮忙吗?
提前感谢。

分配前必须声明空数组

 $form = array();

$form['general_details'] = array(
         '#type' => 'fieldset',
         '#title' => t('General'),
         '#description' => t('General Information.'),
         '#required' => TRUE,
);

$form['general_details']['salutation'] = array(
         '#type' => 'select',....