Avoid using deprecated PHP functions

  • Minor
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/php.use_deprecated_function

Updated rule! We've recently tweaked this rule. This may explain the disappearance of false positives, or new violations not linked to any activity in the code.
  1. // Multiple actions
  2. $action_ary = $this->request->variable('action', ['' => 0]);
  3. if (sizeof($action_ary))
  4. {
  5. list($this->action,) = each($action_ary);

    each() has been deprecated in PHP 7.2 and will be removed from PHP in the next major version.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Khoa Nguyen
  6. }
  7. unset($action_ary);
  8. // URL parameters