Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot assign an empty string to a string offset

Tags:

arrays

string

php

I've just installed PHP 7.1 and now I am seeing this error :

PHP Warning:  Cannot assign an empty string to a string offset in /postfixadmin/variables.inc.php on line 31

Line #31 :

$fDomains[0] = "";

How does on clear $fDomains[0] now in PHP 7.1?

like image 978
Brian Smith Avatar asked Mar 10 '23 01:03

Brian Smith


1 Answers

My reason for this message 'PHP Warning: Cannot assign an empty string to a string offset' is: My $fDomains variable was initiated as a string, not as an array.

like image 108
FantomX1 Avatar answered Mar 12 '23 01:03

FantomX1