diff --git a/.github/workflows/test-coding-standards.yml b/.github/workflows/test-coding-standards.yml
index 9217f48bb127..cd79e13b243e 100644
--- a/.github/workflows/test-coding-standards.yml
+++ b/.github/workflows/test-coding-standards.yml
@@ -28,8 +28,8 @@ jobs:
fail-fast: false
matrix:
php-version:
- - '7.4'
- '8.0'
+ - '8.2'
steps:
- name: Checkout
diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml
index 9ca4ed8e15e4..9beee1b3aa09 100644
--- a/.github/workflows/test-phpunit.yml
+++ b/.github/workflows/test-phpunit.yml
@@ -55,7 +55,6 @@ jobs:
strategy:
matrix:
php-version:
- - '7.4'
- '8.0'
- '8.1'
- '8.2'
@@ -85,7 +84,6 @@ jobs:
fail-fast: false
matrix:
php-version:
- - '7.4'
- '8.0'
- '8.1'
- '8.2'
@@ -99,7 +97,7 @@ jobs:
mysql-version:
- '5.7'
include:
- - php-version: '7.4'
+ - php-version: '8.0'
db-platform: MySQLi
mysql-version: '8.0'
- php-version: '8.3'
@@ -127,7 +125,6 @@ jobs:
strategy:
matrix:
php-version:
- - '7.4'
- '8.0'
- '8.1'
- '8.2'
@@ -156,7 +153,6 @@ jobs:
strategy:
matrix:
php-version:
- - '7.4'
- '8.0'
- '8.1'
- '8.2'
diff --git a/.github/workflows/test-rector.yml b/.github/workflows/test-rector.yml
index 7912a59f5d3f..e29ee6ba64e7 100644
--- a/.github/workflows/test-rector.yml
+++ b/.github/workflows/test-rector.yml
@@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- php-versions: ['7.4', '8.0']
+ php-versions: ['8.0', '8.2']
paths:
- app
- system
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
index 8c2a6b8b7a52..d4d3798ca1cf 100644
--- a/.php-cs-fixer.dist.php
+++ b/.php-cs-fixer.dist.php
@@ -80,13 +80,10 @@
'admin@codeigniter.com'
);
-// @TODO: remove this check when support for PHP 7.4 is dropped
-if (PHP_VERSION_ID >= 80000) {
- $config
- ->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
- ->setRules(array_merge($config->getRules(), [
- NoCodeSeparatorCommentFixer::name() => true,
- ]));
-}
+$config
+ ->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
+ ->setRules(array_merge($config->getRules(), [
+ NoCodeSeparatorCommentFixer::name() => true,
+ ]));
return $config;
diff --git a/.php-cs-fixer.no-header.php b/.php-cs-fixer.no-header.php
index 5fb4ce95bfbe..0b75ff6bfd3f 100644
--- a/.php-cs-fixer.no-header.php
+++ b/.php-cs-fixer.no-header.php
@@ -62,13 +62,10 @@
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
-// @TODO: remove this check when support for PHP 7.4 is dropped
-if (PHP_VERSION_ID >= 80000) {
- $config
- ->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
- ->setRules(array_merge($config->getRules(), [
- NoCodeSeparatorCommentFixer::name() => true,
- ]));
-}
+$config
+ ->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
+ ->setRules(array_merge($config->getRules(), [
+ NoCodeSeparatorCommentFixer::name() => true,
+ ]));
return $config;
diff --git a/.php-cs-fixer.user-guide.php b/.php-cs-fixer.user-guide.php
index cf344d903ad5..af7e896fcecd 100644
--- a/.php-cs-fixer.user-guide.php
+++ b/.php-cs-fixer.user-guide.php
@@ -67,13 +67,10 @@
$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
-// @TODO: remove this check when support for PHP 7.4 is dropped
-if (PHP_VERSION_ID >= 80000) {
- $config
- ->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
- ->setRules(array_merge($config->getRules(), [
- NoCodeSeparatorCommentFixer::name() => true,
- ]));
-}
+$config
+ ->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
+ ->setRules(array_merge($config->getRules(), [
+ NoCodeSeparatorCommentFixer::name() => true,
+ ]));
return $config;
diff --git a/README.md b/README.md
index 1a47301b82cc..d5f8ec34dd51 100644
--- a/README.md
+++ b/README.md
@@ -86,7 +86,7 @@ Made with [contrib.rocks](https://contrib.rocks).
## Server Requirements
-PHP version 7.4 or higher is required, with the following extensions installed:
+PHP version 8.0 or higher is required, with the following extensions installed:
- [intl](http://php.net/manual/en/intl.requirements.php)
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
diff --git a/admin/framework/README.md b/admin/framework/README.md
index 00cdf704c2f4..f6f81cd65184 100644
--- a/admin/framework/README.md
+++ b/admin/framework/README.md
@@ -42,7 +42,7 @@ Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/
## Server Requirements
-PHP version 7.4 or higher is required, with the following extensions installed:
+PHP version 8.0 or higher is required, with the following extensions installed:
- [intl](http://php.net/manual/en/intl.requirements.php)
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
diff --git a/admin/framework/composer.json b/admin/framework/composer.json
index f93daa275b1d..70b51ba8f88c 100644
--- a/admin/framework/composer.json
+++ b/admin/framework/composer.json
@@ -10,7 +10,7 @@
"slack": "https://codeigniterchat.slack.com"
},
"require": {
- "php": "^7.4 || ^8.0",
+ "php": "^8.0",
"ext-intl": "*",
"ext-json": "*",
"ext-mbstring": "*",
diff --git a/admin/starter/.github/workflows/phpunit.yml b/admin/starter/.github/workflows/phpunit.yml
index 73d413cad92f..0489a9376466 100644
--- a/admin/starter/.github/workflows/phpunit.yml
+++ b/admin/starter/.github/workflows/phpunit.yml
@@ -2,7 +2,7 @@ name: PHPUnit
on:
pull_request:
- branches:
+ branches:
- develop
jobs:
@@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
- php-versions: ['7.4', '8.0']
+ php-versions: ['8.0', '8.2']
runs-on: ubuntu-latest
diff --git a/admin/starter/README.md b/admin/starter/README.md
index 11d1cf13eec4..fc8f69b5eb1d 100644
--- a/admin/starter/README.md
+++ b/admin/starter/README.md
@@ -50,7 +50,7 @@ Problems with it can be raised on our forum, or as issues in the main repository
## Server Requirements
-PHP version 7.4 or higher is required, with the following extensions installed:
+PHP version 8.0 or higher is required, with the following extensions installed:
- [intl](http://php.net/manual/en/intl.requirements.php)
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
diff --git a/admin/starter/composer.json b/admin/starter/composer.json
index 082d7b648c25..37c3e5642f29 100644
--- a/admin/starter/composer.json
+++ b/admin/starter/composer.json
@@ -10,7 +10,7 @@
"slack": "https://codeigniterchat.slack.com"
},
"require": {
- "php": "^7.4 || ^8.0",
+ "php": "^8.0",
"codeigniter4/framework": "^4.0"
},
"require-dev": {
diff --git a/composer.json b/composer.json
index 2258eca9ac4d..646f53d5c784 100644
--- a/composer.json
+++ b/composer.json
@@ -10,7 +10,7 @@
"slack": "https://codeigniterchat.slack.com"
},
"require": {
- "php": "^7.4 || ^8.0",
+ "php": "^8.0",
"ext-intl": "*",
"ext-json": "*",
"ext-mbstring": "*",
diff --git a/contributing/pull_request.md b/contributing/pull_request.md
index 0a863fd39746..8e5a489bb519 100644
--- a/contributing/pull_request.md
+++ b/contributing/pull_request.md
@@ -136,7 +136,7 @@ See [Contribution CSS](./css.md).
### Compatibility
-CodeIgniter4 requires [PHP 7.4](https://php.net/releases/7_4_0.php).
+CodeIgniter4 requires [PHP 8.0](https://php.net/releases/8_0_0.php).
### Backwards Compatibility
diff --git a/public/index.php b/public/index.php
index 1cc4710549d5..826966179eec 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1,7 +1,7 @@
=')) {
- $message = preg_last_error_msg();
- } else {
- $message = 'Regex error. error code: ' . preg_last_error();
- }
+ $message = preg_last_error_msg();
throw new RuntimeException($message . '. filename: "' . $filename . '"');
}
diff --git a/tests/system/Debug/TimerTest.php b/tests/system/Debug/TimerTest.php
index 54c9fdfccb18..2be069062d9c 100644
--- a/tests/system/Debug/TimerTest.php
+++ b/tests/system/Debug/TimerTest.php
@@ -13,7 +13,6 @@
use ArgumentCountError;
use CodeIgniter\Test\CIUnitTestCase;
-use ErrorException;
use RuntimeException;
/**
@@ -172,11 +171,7 @@ public function testRecordThrowsException(): void
public function testRecordThrowsErrorOnCallableWithParams(): void
{
- if (PHP_VERSION_ID >= 80000) {
- $this->expectException(ArgumentCountError::class);
- } else {
- $this->expectException(ErrorException::class);
- }
+ $this->expectException(ArgumentCountError::class);
$timer = new Timer();
$timer->record('error', 'strlen');
diff --git a/tests/system/Helpers/ArrayHelperTest.php b/tests/system/Helpers/ArrayHelperTest.php
index 4844fe84188e..2c4ce103adc9 100644
--- a/tests/system/Helpers/ArrayHelperTest.php
+++ b/tests/system/Helpers/ArrayHelperTest.php
@@ -12,7 +12,6 @@
namespace CodeIgniter\Helpers;
use CodeIgniter\Test\CIUnitTestCase;
-use ErrorException;
use ValueError;
/**
@@ -303,13 +302,7 @@ public function testArraySortByMultipleKeysFailsEmptyParameter(array $data, arra
*/
public function testArraySortByMultipleKeysFailsInconsistentArraySizes($data): void
{
- // PHP 8 changes this error type
- if (PHP_VERSION_ID >= 80000) {
- $this->expectException(ValueError::class);
- } else {
- $this->expectException(ErrorException::class);
- }
-
+ $this->expectException(ValueError::class);
$this->expectExceptionMessage('Array sizes are inconsistent');
$sortColumns = [
diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst
index c999b562172f..50dae35cd5a2 100644
--- a/user_guide_src/source/changelogs/v4.5.0.rst
+++ b/user_guide_src/source/changelogs/v4.5.0.rst
@@ -12,6 +12,7 @@ Release Date: Unreleased
Highlights
**********
+- Update minimal PHP requirement to 8.0.
- TBD
BREAKING
diff --git a/user_guide_src/source/installation/installing_composer.rst b/user_guide_src/source/installation/installing_composer.rst
index 9af6a0f0fa71..f1883b61caf3 100644
--- a/user_guide_src/source/installation/installing_composer.rst
+++ b/user_guide_src/source/installation/installing_composer.rst
@@ -139,11 +139,11 @@ Next Minor Version
If you want to use the next minor version branch, after using the ``builds`` command
edit **composer.json** manually.
-If you try the ``4.4`` branch, change the version to ``4.4.x-dev``::
+If you try the ``4.6`` branch, change the version to ``4.6.x-dev``::
"require": {
- "php": "^7.4 || ^8.0",
- "codeigniter4/codeigniter4": "4.4.x-dev"
+ "php": "^8.0",
+ "codeigniter4/codeigniter4": "4.6.x-dev"
},
And run ``composer update`` to sync your vendor
diff --git a/user_guide_src/source/installation/upgrade_4xx.rst b/user_guide_src/source/installation/upgrade_4xx.rst
index ae645d26c1a9..f452fc247f2a 100644
--- a/user_guide_src/source/installation/upgrade_4xx.rst
+++ b/user_guide_src/source/installation/upgrade_4xx.rst
@@ -41,7 +41,7 @@ Downloads
Namespaces
==========
-- CI4 is built for PHP 7.4+, and everything in the framework is namespaced,
+- CI4 is built for PHP 8.0+, and everything in the framework is namespaced,
except for the helper and lang files.
Application Structure
diff --git a/user_guide_src/source/intro/requirements.rst b/user_guide_src/source/intro/requirements.rst
index e025198a8cc0..17154a952563 100644
--- a/user_guide_src/source/intro/requirements.rst
+++ b/user_guide_src/source/intro/requirements.rst
@@ -10,7 +10,7 @@ Server Requirements
PHP and Required Extensions
***************************
-`PHP `_ version 7.4 or newer is required, with the following PHP extensions are enabled:
+`PHP `_ version 8.0 or newer is required, with the following PHP extensions are enabled:
- `intl `_
- `mbstring `_