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.

  • It's too much different question which you duplicated. First of all, please read it :) – Ankita Mar 19 at 10:20
  • apologies for the inconvenience. +1 for your question – Shoaib Munir Mar 19 at 10:23
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;
}
  • Thanks ..!! It's working. – Ankita Mar 19 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.