• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Will CI 3.x work properly with PHP 8.x?

#1
All of our webapps are using CI 3.1.11 with PHP 7.3.x.   To get ready for the upgrade to PHP 8.x on our webservers, I am trying to determine if the current CI 3.1.11 will officially work on PHP 8.x or not.   The documentation just states the min PHP version, but not whether PHP 8 is (or is not) supported.   

If not, I noticed their is a unreleased version of CI 3.2.x in the git repo.   
Will 3.2.x support PHP 8.x when it is released?   

One more thing:   Perhaps CI 3.1.x works in PHP 8.x very well, except for some of its libraries and/or helpers that break if called in PHP 8.x.   It would be helpful to know this as well with a list of those libraries and helpers that break under PHP 8.x.   My webapps only use a very limited set of these components, so that might not prevent me from upgrading to PHP 8.x - and then I can make the migration from CI 3.x to CI 4.x later as time permits. 

I have been using CI 3.x for many years and found it to be very easy to learn and build great webapps.
Thank you all developers and maintainers of CI for keeping it a great framework!
Reply

#2
You can test CI 3.1.11 with PHP 8 on a local server.

You can take a look at the differences from PHP 7 to 8 and search the specific functions in a good PHP IDE and then you can change it.

Bit of work I guess or you wait until someone does it.
Reply

#3
(04-28-2021, 04:58 AM)dkwhisler Wrote: All of our webapps are using CI 3.1.11 with PHP 7.3.x.   To get ready for the upgrade to PHP 8.x on our webservers, I am trying to determine if the current CI 3.1.11 will officially work on PHP 8.x or not.   The documentation just states the min PHP version, but not whether PHP 8 is (or is not) supported.   

If not, I noticed their is a unreleased version of CI 3.2.x in the git repo.   
Will 3.2.x support PHP 8.x when it is released?   

One more thing:   Perhaps CI 3.1.x works in PHP 8.x very well, except for some of its libraries and/or helpers that break if called in PHP 8.x.   It would be helpful to know this as well with a list of those libraries and helpers that break under PHP 8.x.   My webapps only use a very limited set of these components, so that might not prevent me from upgrading to PHP 8.x - and then I can make the migration from CI 3.x to CI 4.x later as time permits. 

I have been using CI 3.x for many years and found it to be very easy to learn and build great webapps.
Thank you all developers and maintainers of CI for keeping it a great framework!

I tested our CI3 app very briefly with PHP8. The main thing that appeared to be broken was flashdata. However it was a very simple fix. I created a pull request for it on GitHub which was accepted.

I also believe some of the migrations code doesn't work properly with PHP8. This was discussed on GitHub - hopefully another simple fix.

I'm not sure about anything else. I'm hoping the community can get things in order before PHP7.4 is EOL because we have one CI3 project which is very important to us, and there's no requirement or desire to completely redevelop it using CI4.
Reply

#4
Thank you for your feedback, please let me know if you find any more issues with running CI3 apps in PHP8, and I will do the same for you. I have quite a few CI3 webapps, so if I have to convert them to CI4 to be able to run PHP8, it would be a huge timesink, without much return for all of the time spent. I did an initial attempt to convert one of the simpler ones to CI4, but it was very frustrating process. Some things that I easily did in CI3 (like getting the value of a POST variable inside of the controller - I did it in CI3 with $this->request->post('varname') don't seem to work when I try it in CI4 with the way the manual says it should work. Keep me posted, and I'll do the same. Thanks!
Reply

#5
I have the variable 'terms' used to input search arguments in a form, it is used in 'Model' and 'Controller', CI4. The variable refers to the 'search' field on the form, as shown below:

PHP Code:
<div class="search-container">
 <
form action="/search/allmedia" class="site-search" method="post" name="site-search">
 <
input class="site-search-button" name="wdeda" type="submit" />
 <
input class="site-search-input" name="search" placeholder="Pesquisar" tabindex="1" type="search" />
 </
form>
 </
div

I use the same variable in Model and Controller:

PHP Code:
// Model

public function getNames() {
        $request = \Config\Services::request();
        $db $this->db;
        $terms $request->getVar('search');
        $query $db->table('names')
        ->select('*')
        ->like('name'$terms)
 
    ->orLike('alias'$terms)
 
    ->orLike('alias2'$terms)
 
    ->orderBy('vip''name''alias''asc')
        ->get();
        
        
        
if( $query->getResult() != null ) {
        
        
return $query->getResult();
        
        
} else {
        
        
return null;
        
        
}
    }

// Controller

 
$terms $this->request->getVar('search');        
        
if (empty($terms)) {
            return redirect()->to('/errors/nodata');
            exit;
        
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.