Skip to content

Conversation

@BastianLedererIcinga
Copy link

@BastianLedererIcinga BastianLedererIcinga commented Nov 24, 2025

Changes that had to be addressed

PHP 8.3 -> PHP 8.4

Migration docs: https://www.php.net/manual/en/migration84

  • Function parameters that are null by default must be declared nullable.
  • Changing the value of session.sid_bits_per_character is deprecated.

PHP 8.4 -> PHP 8.5

Migration Docs: https://www.php.net/manual/en/migration85

  • curl_close() is deprecated in PHP 8.5, curl handles are instead freed automatically.
  • Driver specific PDO constants are deprecated this affects some MySQL driver constants,
    instead of PDO::SQL<constant_name> use Pdo\Mysql::<constant_name>.
  • ReflectionProperty::setAccessible has been deprecated, but did not have any effect since PHP 8.1.
  • Float to int casts, where the original value can't be represented as an integer will emit a warning. floor() must be used before the cast to achieve the previous behavior without a warning.
  • The backtick operator is deprecated, shell_exec() must be used instead.
  • Using null as an array offset or passing it to array_key_exists it deprecated, an empty string must be used instead

resolves: #5269
resolves: #5450

{
$id = trim($id);
$timestamp = (int) $timestamp;
$timestamp = (int) floor($timestamp);
Copy link
Member

Choose a reason for hiding this comment

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

Please make absolutely sure we're dealing with floats here. My feeling is that this change isn't strictly necessary since we're dealing with timestamps and those are usually a result of time() or DateTime->getTimestamp(), in which case it's always an int.

There are probably other cases as well, I won't comment on each one. Please review them again and ensure on your own that you don't floor unnecessarily. It's maybe also an option to prevent decimals in the first place, given the calls are internal only. Though, an exception is Benchmark, as it already floored its timestamp previously so there's no problem to do it still.

protected function namespaceHasApplictionDirectory($namespace)
{
return array_key_exists($namespace, $this->applicationDirectories);
return array_key_exists($namespace ?? '', $this->applicationDirectories);
Copy link
Member

Choose a reason for hiding this comment

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

Why exactly does this need to be guarded but isApplicationPrefix does not? If I follow the calls of namespaceHasApplictionDirectory, I don't seem to find a case when the argument is null.

protected function extractMessageValue(array $path, array $messageData)
{
$key = array_shift($path);
$key = array_shift($path) ?? '';
Copy link
Member

Choose a reason for hiding this comment

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

null won't be part of the array, that's for sure. The regex above must match before this is called and then the match is passed. The recursion on the other hand handles the case already that it stops once the arrays is empty.


foreach ($permissions as $permission) {
if (array_key_exists($permission, self::LEGACY_PERMISSIONS)) {
if ($permission && array_key_exists($permission, self::LEGACY_PERMISSIONS)) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm pretty sure, that if this would be null, remaining code parts will still fail and would have already anyway. So this can't be necessary. 🤔

public function order($columnOrAlias, $dir = null)
{
if (array_key_exists($columnOrAlias, $this->additionalColumns)) {
if ($columnOrAlias && array_key_exists($columnOrAlias, $this->additionalColumns)) {
Copy link
Member

Choose a reason for hiding this comment

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

that's another case of, if you'd follow the alternative path, you'd see that null is not a probably candidate as nothing else works anyway if that's the case.

protected function hasJoinedVirtualTable($name)
{
return array_key_exists($name, $this->joinedVirtualTables);
return array_key_exists($name ?? '', $this->joinedVirtualTables);
Copy link
Member

Choose a reason for hiding this comment

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

Hard to believe that this is required, as my usage search didn't reveal a single case of unguessable types, so to say.

@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 2 times, most recently from 04f618b to bcade4e Compare December 12, 2025 10:31
@lippserd lippserd force-pushed the replace-deprecated-features branch 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
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