nanoid-php icon indicating copy to clipboard operation
nanoid-php copied to clipboard

Proposal: Upgrade to PHP 8.x in a new 2.x release

Open hidehalo opened this issue 2 months ago • 4 comments

I see that Pull Request #28 introduces support for PHP 8.x and drop older version compatibility, which is a great step forward for the project.

To manage this transition smoothly and maintain backward compatibility for existing users, I would like to propose the following versioning strategy:

  • Release as a 2.1.x Version: The changes from PR #28, which require PHP 8.x and drop older version compatibility, should be released as a new minor version (e.g., 2.1.0). Since dropping support for older PHP versions (we already drop <7.1 on #32 ) is a breaking change, releasing a new minor version would be appropriate according to Semantic Versioning.
  • Maintain Backward Compatibility for 1.x|2.0.x Tags: The 1.x & 2.0.x branch should be maintained for users who are still on older PHP versions (e.g., PHP 5.x|7.0). This branch would only receive critical bug fixes, ensuring that existing projects do not break unexpectedly after running composer update.

This approach would provide several benefits:

  • Developers using older PHP versions can continue to use the 1.x, 2.0.x tags without disruption.
  • Projects ready to upgrade to PHP 8.x can explicitly opt-in by requiring ^2.1 in their composer.json.

hidehalo avatar Oct 08 '25 12:10 hidehalo

@jdecool PTAL, thx!

hidehalo avatar Oct 08 '25 12:10 hidehalo

@jdecool PTAL, thx!

Hi! It seems we already implement it on https://github.com/hidehalo/nanoid-php/pull/29 ? 😆

Help me check it, thx!

hidehalo avatar Oct 09 '25 00:10 hidehalo

#29 Is about adding tests with latests PHP version.

My initial comment concerns #28 to update the current code with PHP 8.x features (types with strict types) and drop older version compatibility.

Are you open to those changes ?

jdecool avatar Oct 10 '25 19:10 jdecool

#29 Is about adding tests with latests PHP version.

My initial comment concerns #28 to update the current code with PHP 8.x features (types with strict types) and drop older version compatibility.

Are you open to those changes ?

@jdecool Okay, we'll upgrade the PHP dependency to 8.x.

This will also allow us to use new features like types with strict types, enums and named parameters etc.

Please commit the baseline changes to the 2.x branch. Thx!

Let's do it. xD

hidehalo avatar Oct 11 '25 02:10 hidehalo