Hi, I am using Joomla 3.9 and VirtueMart 3.4.2 and I am using PHP PHP 7.0.33. Joomla displayed a message that I have to switch to a newer version for security reasons.
My hosting provider supports PHP 7.1.30, PHP 7.2.20, PHP 7.3.7. The major problem that exists is that when I am switching in either of the newer versions when I am visiting the shopping card I am getting an error message "[] operator not supported for strings".
Is there a workaround to fix that?
Thanks
Is it an error ? Or is it a warning?
Turn down error reporting. What extension gives the message?
Jörgen @ Kreativ Fotografi
That message appears when going to cart. when switching back to the older unsuported PHP 7.0.33 it works fine.
[] operator not supported for strings
If problems persist, please contact the administrator of this site and report the error below
[] operator not supported for strings
Are you using any special extensions for the cart?
No I am not. I tried also other template and also I have Layout Bootstrap version to None(legacy).
This is realy crazy. When moving to newer PHP PHP 7.1.30, PHP 7.2.20, PHP 7.3.7 stops working and get the operator not supported for stings message.
Only at PHP 7.0.33 works but joomla displays a message that this version is not supported by the creators and need to update to newer version.
you need to trace what is causing this error
plenty of info here: http://forum.virtuemart.net/index.php?topic=117042.0
Thanks for the info
My template is Horme 3 free.
I suppose the problem is this: https://www.php.net/manual/en/language.types.array.php
Creating/modifying with square bracket syntax ¶
An existing array can be modified by explicitly setting values in it.
This is done by assigning values to the array, specifying the key in brackets. The key can also be omitted, resulting in an empty pair of brackets ([]).
$arr[key] = value;
$arr[] = value;
// key may be an integer or string
// value may be any value of any type
If $arr doesn't exist yet, it will be created, so this is also an alternative way to create an array. This practice is however discouraged because if $arr already contains some value (e.g. string from request variable) then this value will stay in the place and [] may actually stand for string access operator. It is always better to initialize a variable by a direct assignment.
Note: As of PHP 7.1.0, applying the empty index operator on a string throws a fatal error. Formerly, the string was silently converted to an array.
but he still needs to trace WHERE this is being called...