Codeigniter Deprecated dynamic properties in PHP 8.2

Error Message: Creation of dynamic property CI_URI::$config is deprecated

Better way is to implement #[\AllowDynamicProperties]

Easier and much shorter.

In all the above mentioned classes add #[\AllowDynamicProperties] above class xxxxxx {

I give you my changes:

/system/core/URI.php

#[\AllowDynamicProperties]

class CI_URI {

/system/core/Router.php

#[\AllowDynamicProperties]

class CI_Router {

/system/core/Loader.php

#[\AllowDynamicProperties]

class CI_Loader {

/system/core/Controller.php

#[\AllowDynamicProperties]

class CI_Controller {   

/system/core/DB_driver.php

#[\AllowDynamicProperties]

abstract class CI_DB_driver {

Source: https://forum.codeigniter.com/printthread.php?tid=82678