vinkla / hashids

A small PHP library to generate YouTube-like ids from numbers. Use it when you don't want to expose your database ids to the user.
https://hashids.org/php
MIT License
5.28k stars 418 forks source link

[3.0] Remove PHP 5 support #107

Closed vinkla closed 6 years ago

vinkla commented 6 years ago

This pull request removes support for legacy PHP versions. PHP 5.6 and 7.0 sees EOL this year and a lot of frameworks such as Laravel and Symfony has already dropped support for those versions.

This wont be an issue for users of older PHP versions since this will be a part of an major release and we won't be adding any breaking changes.

Yogarine commented 6 years ago

I realise this pull request has already been merged but I wanted to comment here just to make sure this mistake won't be made in the future.

Just bumping requirements without actually implementing new features "just because PHP 5 will be EOL" doesn't add anything useful.

Bumping requirements should be a natural process where you decide to use a new feature which in turn requires you to break compatibility. As long as there is no actual pressing need to do so, you shouldn't just bump requirements. The more compatible your code is, the better. Right now this is a PHP 5.6 compatible package that is synthetically made incompatible. It doesn't actually "[remove] support for legacy PHP versions". It just artificially breaks compatibility.

I do realise you might want to incentivise your user base to upgrade to a newer version of PHP, but there are many cases where this simply might not be feasible, or necessary. (For example, PHP is used in internal systems that aren't web-facing and therefore are not susceptible to being hacked, while stability is more important than having the newest features. Also on embedded systems it's not always possible to update to the newest PHP versions.)

So, hey, if you really want to bump to PHP 7.1 go ahead. But how about actually using some PHP 7.1 features like types while you're at it?

vinkla commented 6 years ago

So, hey, if you really want to bump to PHP 7.1 go ahead. But how about actually using some PHP 7.1 features like types while you're at it?

We welcome any pull request you send our way.

GeorgeGardiner commented 5 years ago

Bumping requirements without actually implementing new features is very irritating. I could waste my day fixing this, downgrade to 3.0.0, or just ditch the project altogether and write my own algo.

Screenshot 2019-04-29 at 13 44 25
Yogarine commented 5 years ago

Exactly. It doesn’t even make sense. Why would you arbitrarily bump a requirement without using it?

On the other side. This is why you should always pin composer requirements to specific major versions and never use “master” or “*”.