lundi 31 mai 2021

an Issue in count statement of PHP

During the implementation of multichain-web-demo, I got an error as following

   Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given line 96

code around 96th line is as follows

        foreach ($addressmine as $address => $ismine) {
            if (count(@$addresspermissions[$address]))                      // 96th line
                $permissions=implode(', ', @array_keys($addresspermissions[$address]));
            else
                $permissions='none';
                
            $label=@$labels[$address];
            $cansetlabel=$ismine && @$addresspermissions[$address]['send'];

I am new to PHP world, forgive me for any mistakes. Thank you.

Aucun commentaire:

Enregistrer un commentaire