0

i got an error on this component with joomla3 and i'm not know what should i do due to make it ok: the error is :

( ! ) Deprecated: The each() function is deprecated. This message will be suppressed on further calls in D:\wamp64\www\tesla36034\components\com_accessmanager\checkaccess2.php on line 551

and this line is:

$temp = $asset_array['core.login.admin'];       
    for($n = 0; $n < count($temp); $n++){
        $row = each($temp);
        if($row['value']=='1'){                         
            $this->set_backend_usergroup($row['key']);
        }
    }
Zoe
  • 27,060
  • 21
  • 118
  • 148
  • Sorry you do mean it is deprecated in PHP, see: https://www.php.net/manual/en/function.each.php **Warning** _This function has been DEPRECATED as of PHP 7.2.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged_. – Luuk Dec 11 '21 at 14:57
  • https://www.php.net/manual/en/function.each.php deprecated as of php 7,2 – Dimitris Papageorgiou Dec 11 '21 at 14:58
  • but luckily Stackoverfow has an answer: [How can I update code that uses the deprecated each() function?](https://stackoverflow.com/questions/46492621/how-can-i-update-code-that-uses-the-deprecated-each-function) – Luuk Dec 11 '21 at 14:59
  • Does this answer your question? [How can I update code that uses the deprecated each() function?](https://stackoverflow.com/questions/46492621/how-can-i-update-code-that-uses-the-deprecated-each-function) – Luuk Dec 11 '21 at 15:00
  • I'm not professional in PHP so with those answers i can't find a solution – Mohammad Ahmad Dec 11 '21 at 18:40
  • `foreach ($asset_array['core.login.admin'] as $row) { if($row['value']=='1'){ $this->set_backend_usergroup($row['key']); } }` ...if you are a Joomla users or developer, please join [joomla.se] Stack Exchange. @Moh – mickmackusa Jan 31 '22 at 05:35

0 Answers0