Skip to content

Using Dynamic Properties on Classes running PHP 8.2 will lead to PHP Deprecated: Creation of dynamic property is deprecated E_DEPRECATED warnings. #30

@Russell-Jones-OxPhys

Description

@Russell-Jones-OxPhys

In the GLPI reports plugin this shows up as
PHP Deprecated function (8192): Creation of dynamic property PluginReportsAutoReport::$plug is deprecated in /var/www/html/glpi/plugins/reports/inc/autoreport.class.php at line 57

$this->plug = $regs[2];

See
https://stackoverflow.com/questions/74991682/php-8-2-dynamic-properties-deprecated-how-to-use-them-anyway-in-a-compatible-wa
for possible solutions. The options are to rework the class to not use dynamic properties, to extend stdClass, or to add an attribute.

Support will be dropped in PHP9, apparently, but that's not on the PHP version support grid yet https://www.php.net/supported-versions.php

I'd like to submit a PR, but I don't think I'm likely to do that any time soon, as I don't know the plugin code (or GLPI, for that matter) well enough.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions