Skip to content

Bump minimum PHP version #671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
colinodell opened this issue Jun 16, 2021 · 3 comments · Fixed by #677
Closed

Bump minimum PHP version #671

colinodell opened this issue Jun 16, 2021 · 3 comments · Fixed by #677
Assignees
Labels
do not close Issue which won't close due to inactivity implemented Change has been implemented
Milestone

Comments

@colinodell
Copy link
Member

Based on feedback in #625, the minimum PHP version will be bumped further to either 7.4 or 8.0 for the upcoming 2.0 release. This decision will be based on the following:

  • Whether this library would significantly benefit from features only found in 8.0
  • Whether the user base would be positively or negatively impacted by not having a maintained 7.x-compatible version
  • Whether supporting 7.4 would be detrimental to the future development and maintenance of the 2.x branch

While I appreciate that there are strong arguments for/against dropping 7.4 support, I ask that any comments on this issue be respectful of the points above.

@colinodell colinodell added this to the v2.0 milestone Jun 16, 2021
@colinodell colinodell self-assigned this Jun 16, 2021
@colinodell colinodell added the do not close Issue which won't close due to inactivity label Jun 16, 2021
@markhalliwell
Copy link
Contributor

PHP 8 introduces a LOT of nice syntax and features that helps clean up code and improve DX:

  • Named arguments
  • Constructor property promotion
  • Match expression
  • Nullsafe operator (best improvement IMO)
  • Union types (second best)
  • WeakMap class
  • Stringable interface (can finally remove symfony/polyfill-php80)
  • mixed type
  • static return type

And so much more...

@colinodell colinodell linked a pull request Jun 20, 2021 that will close this issue
@colinodell
Copy link
Member Author

Based on my in-progress work in #677 (and some un-pushed work), I've evaluated most of the major PHP 8.0 features and have come to the following conclusions:

  • Type improvements (like union types, mixed, and static) would be awesome
  • Syntactic sugar (like match expressions and the nullsafe operator) isn't overly helpful but we'd use it
  • I have no use for named arguments or constructor property promotion
  • We mostly use Stringable for return types so symfony/polyfill-php80 works just as well for our needs
  • I have not yet found a use for weakmaps, though I'm still looking for one.

IMO PHP 7.4 offers more direct benefits to this library (like mb_str_split(), covariance, and contravariance) than PHP 8.0 does, but I'm continuing my efforts to determine whether the benefits of PHP 8's features justify adding another major upgrade hurdle to 70% of our users on PHP 7.x.

@colinodell
Copy link
Member Author

After further reflection, I've decided that we'll continue to support 7.4+ in version 2.0 for the following reasons:

  • We fully support 8.0 regardless
  • There's nothing we need in 8.0 that isn't already being addressed with other viable solutions (like psalm, phpstan, and symfony/polyfill-php80)
  • PHP 7.4 will receive security support for the next 16 months
  • Version 3.0 of this library will likely be released in the next 12-16 months
  • 70-75% of our users are not on 8.0 yet
  • People have been waiting long enough for our 2.0 release :)

We'll therefore continue supporting 7.4 for now and drop support in our future 3.0 release.

@colinodell colinodell added the implemented Change has been implemented label Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not close Issue which won't close due to inactivity implemented Change has been implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants