Fatal error: Cannot use assign-op operators with o

2019-02-23 09:16发布

问题:

I am getting following error

Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Price.php on line 126

On my server when try to filter product in product grid.

I am not changed any core files at all, but it showing the core file line 126.

I googled for this issue, no proper result. Is there anybody who got this problem and solved it.?

I am not sure but is this a PHP Version problem? Because same application working fine on localhost, In my local machine I have PHP 5.5.18 and in server its 5.3.

Thanks in advance :)

回答1:

I know this isn't a version problem, but could not tell you what it actually is. I just ran across the same issue on my localhost. It worked in one app, not the other, running php5.59.

Inspect the code, it is probably something like this:

$data[2] .= $additionaldata;

It needs to be changed to

$data[2] = $data[2].$additionaldata;


回答2:

I had the same issue! In my case, I declared a variable with an array and by mistake I just used it in another moment! Something like that:

$myArr = array();
// ...

$myArr = 'Some text';
// ...

$myArr[4] += 1; // Here the error shows!

So, basically.. I was trying to add 1 in a string. Then I just changed the string variable to another name and the problem was solved:

$someLabel = 'Some text';

I hope it helps you in your issue!