0

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 :(

2
  • what is the value of $option? it probably is an array or an object that can't be used as an index. that should be the problem. Commented Mar 16, 2019 at 16:47
  • When I do gettype for $opton it say string :( Commented Mar 16, 2019 at 17:04

1 Answer 1

0

I revert PHP from 7.2 to 7.0 and all work

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.