Skip to content

Raise supported PHP version to 8.0 and related updates#25

Open
reedy wants to merge 1 commit intothecodedrift:mainfrom
reedy:php8
Open

Raise supported PHP version to 8.0 and related updates#25
reedy wants to merge 1 commit intothecodedrift:mainfrom
reedy:php8

Conversation

@reedy
Copy link
Copy Markdown
Collaborator

@reedy reedy commented Mar 22, 2026

Fixes #19

@reedy
Copy link
Copy Markdown
Collaborator Author

reedy commented Mar 22, 2026

Basically zero functional changes... Does help not having to worry about testing on ancient PHP versions...

https://www.php.net/eol.php

Still supported (by this library):

8.1 - 31 Dec 2025

8.0 - 26 Nov 2023

Dropped:

7.4 - 28 Nov 2022

7.3 - 6 Dec 2021

7.2 - 30 Nov 2020

https://www.php.net/supported-versions.php

8.2 is out of active support (31 Dec 2024), and security support drops on 31 Dec 2026

8.3 is also out of active support (31 Dec 2025), but security support has a bit longer left (31 Dec 2027)

* @return HOTPResult[]
*/
public static function generateByTimeWindow(string $key, int $window, int $min = -1, int $max = 1, $timestamp = false): array
public static function generateByTimeWindow(string $key, int $window, int $min = -1, int $max = 1, int|false $timestamp = false): array
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick check. Would this typing change also result in older versions no longer being able to run the library (and would we bump major to do this)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So yeah, to the first part.

In theory composer should take notice of that PHP requirement, and wouldn't let it be installed on an incompatible environment. Obviously, if they run it with --ignore-platform-reqs well that's on them!

Regarding the second part, that seems to be a case of "depends who you ask".

Bumping the major definitely makes it easier and cleaner, and I did do that in https://github.com/thecodedrift/hotp-php/releases/tag/v2.0.0 but I haven't looked what else may have changed between that and the previous reelase.

But some people do argue that because of the version checking in composer, it shouldn't install an incompatible version, and we're not actually doing an api breaking change (I think) which would usually necessitate doing a major version bump.

I'm certainly in no rush for this to be merged and/or released, it was double checking if/what could change if we dropped those older PHP versions.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm just very used to the node approach to semver, where we bump semver-major whenever we remove engine versions. But, unlike composer, node's engine field is loosely enforced.

I'm comfortable with just bumping minor if the PHP requirement gets enforced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dropping PHP 7.x support

2 participants