3

In Magento 1, I have been getting this error:

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /var/www/html/test/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php on line 757

Code:

if (is_array($table)) {
    list($tableAlias, $tableName) = each($table);
} else {
    $tableName = $table;
}

How to solve this?

Any help would be much appreciated.

2
  • It's too much different question which you duplicated. First of all, please read it :) Commented Mar 19, 2019 at 10:20
  • apologies for the inconvenience. +1 for your question Commented Mar 19, 2019 at 10:23

1 Answer 1

6

You should replace this below code in if condition :

list($tableAlias, $tableName) = [key($table), current($table)];

As like :

if (is_array($table)) {
    list($tableAlias, $tableName) = [key($table), current($table)];
} else {
    $tableName = $table;
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.