Icinga/icingaweb2

Support PHP 8.3

Closed this issue · 2 comments

Describe the bug

Calling ldap_connect() with separate hostname and port is deprecated.

https://github.com/php/php-src/blob/php-8.3.0RC1/UPGRADING#L184C5-L184C74

But this is exactly what we do:

https://github.com/Icinga/icingaweb2/blob/v2.12.0/library/Icinga/Protocol/Ldap/LdapConnection.php#L1201

To Reproduce

  1. Try to add LDAP resource
  2. Check PHP deprecation notice on the screen

Expected behavior

LDAP just works.

Screenshots

Bildschirmfoto 2023-10-05 um 16 03 02

Your Environment

  • Icinga Web 2 version and modules (System - About): master
  • Web browser used: Safari
  • Icinga 2 version used (icinga2 --version): -
  • PHP version used (php --version): 8.3.0 RC3
  • Server operating system and version: Fedora 40

Other notable changes

Executing proc_get_status() multiple times

https://www.php.net/manual/en/migration83.incompatible.php#migration83.incompatible.core.proc-get-status-multiple-times

Applicable to:

  • icingaweb2/modules/monitoring/library/Monitoring/Command/Transport/RemoteCommandFile.php
  • pdfexport/library/Pdfexport/ShellCommand.php

Both shouldn't be strongly affected.

Uses of traits with static properties

https://www.php.net/manual/en/migration83.incompatible.php#migration83.incompatible.core.traits-with-static-properties

Applicable to:

  • graphite/library/Graphite/Graphing/GraphingTrait.php
  • ipl/web/src/FormElement/ScheduleElement/Common/FieldsUtils.php

The first is mainly used in controllers and clicommands, thus not affected by the new behavior. Though, a widget Graphs also uses it, probably in parallel with one of the controllers/clicommands. Will check whether that's a problem later.
The latter seems to use them instead of constants. Weird, but not a problem.

Assigning a negative index to an empty array

https://www.php.net/manual/en/migration83.incompatible.php#migration83.incompatible.core.negative-index-to-empty-array

Difficult to check. phpstan will hopefully do so.

The range() function has had various changes

https://www.php.net/manual/en/migration83.incompatible.php#migration83.incompatible.standard

Funny. range('0', '9') will now return strings in the array, whereas range('0', '10') does not. (or anything larger than one char) Should not be applicable to us. If it is, phpstan will hopefully detect it.

Saner Increment/Decrement operators

https://www.php.net/manual/en/migration83.deprecated.php#migration83.deprecated.core.saner-inc-dec-operators

Difficult to check. phpstan will hopefully do so.

get_class()/get_parent_class() call without arguments

https://www.php.net/manual/en/migration83.deprecated.php#migration83.deprecated.core.get-class

Not applicable to our code parts, but to a vendor part. (zf1-future's OpenId extension, unused by us)

Will check whether that's a problem later.

Did some testing. Seems to have no effect.