Welcome Guest, Not a member yet? Register   Sign In
Deprecated dynamic properties in PHP 8.2
#4

(This post was last modified: 01-19-2023, 06:54 AM by ubeljan.)

(01-17-2023, 03:58 PM)Codeigniter 3 and PHP 8.2To get rid of the error messages you have to change some variables in the system map.
With this changes I could access the database and email libraries without error messages.
Add the public variables to the mentioned files./system/core/URI.php Wrote:
class CI_URI {

    public $config;
   
   
/system/core/Router.php   

class CI_Router {

    public $uri;
   
   
/system/core/Loader.php 
   
class CI_Loader {
   
    public $load;
    public $benchmark;
    public $config;
    public $log;
    public $hooks;
    public $utf8;
    public $uri;
    public $router;
    public $exceptions;
    public $output;
    public $security;
    public $input;
    public $lang; 
   
   
/system/core/Controller.php     
   
class CI_Controller {

    public $benchmark;   
    public $config;
    public $log;   
    public $hooks; 
    public $utf8;   
    public $uri;
    public $router;   
    public $exceptions;   
    public $output;   
    public $security;
    public $input;   
    public $lang; 
    public $db;     
    public $email;

Please correct me when I'm wrong.

Ubel Jan van Wijhe


sneakyimpIs there any plan to fix this in CI3?

From what I recall, CI uses dynamically assigned properties rampantly. I'm trying to upgrade a site running on PHP 7 (which is EOL as of 2022/11/28) and there are a whole lot of dynamic property deprecation errors. These errors in my case are limited to about 6 classes (at least for the one page i've looked at so far) but I  suspect there are more classes with this problem. I created an issue on the ci3 repo. I hope others might go chime in over there.

Also, is this a problem in CI4?
Reply


Messages In This Thread
RE: Deprecated dynamic properties in PHP 8.2 - by ubeljan - 01-19-2023, 06:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB