Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 4 and PHP 8
#1

(This post was last modified: 08-12-2020, 01:22 AM by ViLar.)

Hello,

As PHP 8 first Beta was released I had the curiosity to check the framework's compatibility with it. To make it short it's pretty cool and good but I stepped on some new errors like `is_callable` function needing an Object instead of a string to work properly or errors being thrown if you declare parameters with default value before parameters without in functions. Of course the entire code was not covered by those small tests. 

Then I wondered if there were any reflexion on the PHP 8 compatibility with Codeigniter 4 and if yes, where could we check and / or contribute to it? If no, do you think we should start building compatibility right now or wait for the stable release by the end of the year?

Here's a reminder of PHP 8 Timetable : https://wiki.php.net/todo/php80

Thanks Smile
Reply
#2

Personally I don't think it's worth fixing anything until there are a release candidate out. As it's subjected to change (or be fixed), how that function behave anyway. Haven't seen any talk about PHP 8.0, personally I have never used for e.g. 7.0, I started using it officially in 7.1 when all bugs and quarks have sorted itself out. Or at least a bugfix release have been made.

Will personally only be doing small test with PHP 8.0 RC3 and on wards, if I have the time. Professionally, I won't test it before e.g 8.0.5 have been released, as it's time to jump ship and skip 7.4 and go from 7.3 into 8.0.
Reply
#3

@ViLar,
Quote:Then I wondered if there were any reflexion on the PHP 8 compatibility with Codeigniter 4 and if yes, where could we check and / or contribute to it? If no, do you think we should start building compatibility right now or wait for the stable release by the end of the year?

I had a quick search at downloading and installing onto a Ubuntu 18.04 system and could not find "sudo apt install php80-beta..." and it is so long ago that I built from scratch that I was not able to compile the download Sad

I'm looking forward to testing especially since I use a 100% strict_types system folder.
Reply
#4

Has anybody tested CI4 with PHP 8? I am sorta short of disk space and too busy for a spring cleanup to open up free space so as to be able to set up an isolated PHP8-based AMP environment, meanwhile wondering if anyone keen to share any experiences CI4 & PHP8.

CodeIgniter Wizard (CRUD code generator for Mac) instantly scaffolds Bootstrap-based web applications with an administrative interface (admin templates include Bootstrap5)

Reply
#5

(01-04-2021, 01:08 PM)gosocial2 Wrote: Has anybody tested CI4 with PHP 8? I am sorta short of disk space and too busy for a spring cleanup to open up free space so as to be able to set up an isolated PHP8-based AMP environment, meanwhile wondering if anyone keen to share any experiences CI4 & PHP8.
CI4.0.4 not working well on PHP8 wait till version 4.2 is realeased!
Reply
#6

(This post was last modified: 01-04-2021, 11:35 PM by John_Betong.)

I have just git cloned the latest CI4 Version and it works OK with PHP phpversion: 8.0.0.

The the only KLUDGE I had to make was to disable mbstring in the following:

File: /system/CodeIgniter.php
Code:
protected function resolvePlatformExtensions()
{
$requiredExtensions = [
'curl',
'intl',
'json',
# 'mbstring',
'xml',
];

I'm quite busy at the moment and would be grateful if some one could resolve the problem. I have enabled PHP 8.0.0 mbstring but it still does not work.

Maybe teaching old coders to suck eggs but anyway once more than one PHP version is installed I toggle the two different versions using the following:
Code:
#!/bin/bash

# COMAND LINE:
# `/./php-8.sh

sudo a2dismod php7.4
sudo a2enmod  php8.0

systemctl restart apache2

The last command does not work from the batch file and I have to enter the text into the COMMAND LINE.
Reply
#7

(01-04-2021, 11:33 PM)John_Betong Wrote: I have just git cloned the latest CI4 Version and it works OK with PHP phpversion: 8.0.0.


Main problem I face when upgrading my CI4 apps to PHP8.0 is this : 

[Image: 103UQIe.png]

Aren't you facing it?
Reply
#8

(This post was last modified: 01-05-2021, 09:06 AM by John_Betong.)

@ViLar,
> Aren't you facing it?

I cannot say at the moment because tapping on a tablet.

I had a lot of errors and they all cleared when I applied the KLUDGE.

Did you try disabling mbstring?
Reply
#9

Latest changes to develop are mostly to correct required after optional arguments. In develop, there is a fix already but in the 4.1 branch there is also another fix.
Reply
#10

(01-05-2021, 11:55 PM)paulbalandan Wrote: Latest changes to develop are mostly to correct required after optional arguments. In develop, there is a fix already but in the 4.1 branch there is also another fix.
Any hint of 4.1 release date because me especially checking the workflow on github I don't think the release date is close.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB