[] operator not supported for strings when visiting the basket php 7.1

Started by cmvrgr, July 24, 2019, 15:45:39 PM

Previous topic - Next topic

cmvrgr

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

Jörgen

Is it an error ? Or is it a warning?
Turn down error reporting. What extension gives the message?
Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

cmvrgr

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

StefanSTS

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

cmvrgr

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.

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

cmvrgr


jjk

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.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation