Skip to content

Support PHP 8.5#5454

Merged
lippserd merged 10 commits intomainfrom
replace-deprecated-features
Mar 20, 2026
Merged

Support PHP 8.5#5454
lippserd merged 10 commits intomainfrom
replace-deprecated-features

Conversation

@BastianLedererIcinga
Copy link
Contributor

@BastianLedererIcinga BastianLedererIcinga commented Nov 24, 2025

PHP 8.4

  • Change implicit nullable type declaration to explicit
  • Only set session.sid_bits_per_character for PHP < 8.4

Migration Docs

PHP 8.5

  • Remove no-op ReflectionProperty::setAccessible() calls
  • Replace backtick operator with shell_exec()
  • Avoid passing null as key in array_key_exists()
  • Avoid passing null to non-nullable parameters in built-in functions
  • Use Pdo\Mysql driver-specific constants

Migration Docs

Other compatibility fixes

  • Avoid passing null as ipl\Html form element $name
  • Use latest PHPUnit version

resolves #5269
resolves #5450
requires Icinga/ipl-sql#99

@nilmerg
Copy link
Member

nilmerg commented Nov 28, 2025

Also, the changes to the monitoring module seem implausible to be complete. You already acknowledged in person that you didn't test it yet since you don't have the IDO enabled/configured. Please talk to @lippserd whether that's necessary to begin with.

@nilmerg nilmerg added this to the 2.13 milestone Nov 28, 2025
@nilmerg
Copy link
Member

nilmerg commented Nov 28, 2025

The fact that 730af4c doesn't conditionally call setAccessible still, means that this only works on PHP >= 8.1, so this plays into the question what will happen with monitoring.

@BastianLedererIcinga BastianLedererIcinga changed the title Replace deprecated features Support PHP 8.4/8.5 Dec 5, 2025
@lippserd lippserd force-pushed the replace-deprecated-features branch 3 times, most recently from bcade4e to d5c87b1 Compare December 12, 2025 10:39
@BastianLedererIcinga BastianLedererIcinga force-pushed the replace-deprecated-features branch from 21293ec to d5c87b1 Compare December 12, 2025 12:51
@BastianLedererIcinga BastianLedererIcinga force-pushed the replace-deprecated-features branch 2 times, most recently from 03995b3 to be1b54a Compare January 22, 2026 11:08
Copy link
Contributor

@sukhwinder33445 sukhwinder33445 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏽

@lippserd lippserd force-pushed the replace-deprecated-features branch from be1b54a to 29264ff Compare March 9, 2026 15:43
@lippserd lippserd changed the title Support PHP 8.4/8.5 Support PHP 8.5 Mar 9, 2026
lippserd
lippserd previously approved these changes Mar 10, 2026
Since PHP 8.4 implicitly nullable parameter types are deprecated.

Normalize scoped PHPDoc for nullable-parameter updates: use `?Type` instead of
`Type|null`, remove column alignment, and indent continuation lines with 2
spaces.

Co-authored-by: "Eric Lippmann <eric.lippmann@icinga.com>"
`ReflectionProperty::setAccessible()` has had no effect since PHP 8.1, as all
properties are accessible via reflection by default. The method is deprecated
as of PHP 8.5.
The backtick operator is deprecated as of PHP 8.5.
Calling `array_key_exists()` with a `null` key is deprecated as of PHP 8.5.
PHP 8.4 has deprecated `session.sid_bits_per_character` along with
`session.sid_length`, as part of a broader effort to standardize session ID
generation for improved security and interoperability.
@lippserd lippserd force-pushed the replace-deprecated-features branch from 29264ff to e0dd270 Compare March 10, 2026 15:40
@lippserd
Copy link
Member

I will push an upgrading entry for the IPL requirement after I have determined which version we will use for introducing backward-incompatible changes, and then merge the PR.

@lippserd lippserd force-pushed the replace-deprecated-features branch from e0dd270 to 1a4719b Compare March 19, 2026 21:23
BastianLedererIcinga and others added 5 commits March 19, 2026 22:27
Forward compatibility fix: `ipl\Html` will introduce strict types, which
declares `$name` as string. Passing `null` will result in a `TypeError` once
strict types are enforced.
PHP 8.1 deprecated passing `null` to non-nullable parameters in built-in
functions (deprecated in 8.1, will become a `TypeError` in 9.0).
Replace deprecated `PDO::MYSQL_*` constant usage with the driver-specific
`Pdo\Mysql::ATTR_*` constants introduced in PHP 8.4.

This prepares the code for PHP 8.5, where accessing MySQL driver constants
through the generic `PDO` class is deprecated.

This change requires a compatibility shim on older PHP versions to provide
`Pdo\Mysql` for runtimes that do not expose the driver-specific class yet.  The
shim is provided in `ipl-sql`. As a consequence, the required version of the
Icinga PHP library has been raised.
Remove errors no longer reported. Since PHP 7.x is no longer supported, remove
the 7.x baseline. It is now no longer necessary to have multiple baseline
files.
@lippserd lippserd force-pushed the replace-deprecated-features branch from 1a4719b to 9bd53ac Compare March 20, 2026 13:53
@lippserd lippserd merged commit ad81554 into main Mar 20, 2026
13 checks passed
@lippserd lippserd deleted the replace-deprecated-features branch March 20, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for PHP 8.5 Support PHP 8.4 (with ICINGAWEB_ENVIRONMENT=dev)

4 participants