From 2fb361bf6df6a518fd30ea868ba39a727d113d88 Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Tue, 3 Nov 2026 16:28:54 +0530 Subject: [PATCH] Support PHP 7.4 and later --- .github/workflows/check.yml | 2 +- README.md | 2 +- UPDATING.md | 4 ++-- composer.json | 2 +- tests/factories/TestApp.php | 5 +++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index a79c302..6a0ec7a 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php-version: ['7.4', '8.1', '8.2', '8.3', '8.4', '8.5'] protocol: [ 'json', 'msgpack' ] ignorePlatformReq: [ '' ] diff --git a/README.md b/README.md index 6b10af9..ea7a86c 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Ably aims to support a wide range of platforms. If you experience any compatibil | Platform | Support | | --- | --- | -| PHP | 8.1, 8.2, 8.3, 8.4, 8.5 | +| PHP | 7.4 and later (tested on 7.4 and 8.1 – 8.5) | --- diff --git a/UPDATING.md b/UPDATING.md index 7778488..cac3573 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -18,7 +18,7 @@ The client `Server::createHttpClient()` returns is the same REST client as befor | `AblyRest::setAblyAgentHeader('x', 'v')` | `Server::createHttpClient(['agents' => ['x' => 'v'], …])` | | `AblyRest::setLibraryFlavourString('x')` | removed — use the `agents` option | | `require 'ably-loader.php';` | removed — use Composer's autoloader (`vendor/autoload.php`) | -| PHP 7.2 – 8.0 | PHP `^8.1` (tested on 8.1 – 8.5) | +| PHP 7.2 – 8.0 | PHP 7.4 or later (tested on 7.4 and 8.1 – 8.5); 2.0.0 itself required PHP 8.1 | | `\Ably\AblyRest` type hints | `\Ably\PubSub\PubSubHttpClient` ([091d](https://ably.atlassian.net/wiki/spaces/product/pages/5363957781)) | | `'environment' => 'sandbox'` / `'restHost' => '…'` | `'endpoint' => …` (see [Endpoint](#endpoint-replaces-environment-and-resthost)) | @@ -106,7 +106,7 @@ The `agents` option is per-client, unlike the process-global static setters it r * `ably-loader.php`, the hand-rolled autoloader — Composer is the only supported install path. * The `environment` and `restHost` client options — replaced by `endpoint`. They are ignored if passed. * The `demo/` Heroku application and its `Procfile`. -* PHP 7.2 – 8.0 support. +* PHP 7.2 – 8.0 support. Releases after 2.0.0 support PHP 7.4 and later again, so only PHP 7.2 and 7.3 remain unsupported. `Auth::authorise()`, the British-spelling alias deprecated in favour of `Auth::authorize()`, is still present in 2.0.0. diff --git a/composer.json b/composer.json index 1b46f0d..c6e32fb 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "issues": "https://github.com/ably/ably-pubsub-php/issues" }, "require": { - "php": "^8.1", + "php": "^7.4 || ^8.0", "rybakit/msgpack": "^0.9.1 || ^1.0", "ext-json" : "*", "ext-curl" : "*", diff --git a/tests/factories/TestApp.php b/tests/factories/TestApp.php index c6ccdc0..8124004 100644 --- a/tests/factories/TestApp.php +++ b/tests/factories/TestApp.php @@ -127,8 +127,9 @@ private function request( $mode, $url, $headers = [], $params = '' ) { var_dump(curl_error($ch)); // Prints curl request error if exists } - // curl_close() has no effect since PHP 8.0 and is deprecated since 8.5; - // the handle is released when $ch goes out of scope. The floor is 8.1. + // curl_close() has no effect since PHP 8.0 and is deprecated since 8.5. + // On every supported version (7.4 and later) the handle is released + // when its last reference goes away, so unset() is enough. unset($ch); if ($this->debugRequests) {