Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Russell-Jones-OxPhys opened this issue Jun 5, 2024 · 0 comments

Comments

@Russell-Jones-OxPhys
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant