问题:警告:[重复]中的非法偏移类型

This question already has an answer here:

Im getting this error on line $options[ $option ] = $value;

Warning: Illegal offset type in

and code is:

    public function set_option( $option = '', $value = '' ) {

    if ( $option == '' ) {
        return;
    }

    // get current options
    $options = $this->options();

    // set options
    $options[ $option ] = $value;

    // save options
    $this->options = $options;

    }

I do gettype of $option and it say string :(

</div>

I revert PHP from 7.2 to 7.0 and all work