PHP8: deprecated code

Created on 29 April 2022, over 2 years ago
Updated 10 March 2024, 9 months ago

Problem/Motivation

When upgrading to PHP8, I got this warning:

FILE: hierarchical_select/hierarchical_select.module
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 1388 | WARNING | Declaring a required parameter after an optional one is deprecated since PHP 8.0. Parameter $dropbox is optional, while parameter $module is required.
 1388 | WARNING | Declaring a required parameter after an optional one is deprecated since PHP 8.0. Parameter $dropbox is optional, while parameter $params is required.
 1388 | WARNING | Declaring a required parameter after an optional one is deprecated since PHP 8.0. Parameter $dropbox is optional, while parameter $save_lineage is required.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Upgrade server to PHP8, then run a drush command and see warning.

Proposed resolution

Update parameters in function declaration.

πŸ› Bug report
Status

RTBC

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine shkiper

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024