flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.62k stars 409 forks source link

PHP 7.4/8.0/8.1 compatibility #439

Closed masroore closed 2 years ago

masroore commented 3 years ago
mikecao commented 3 years ago

I think this could be a great fork, but I would like the original to be backward compatible to 4.3, instead of forcing everyone to upgrade.

masroore commented 3 years ago

You could create a separate branch for those who require backwards compatibility.

fp07 commented 2 years ago

@mikecao This is needed to update projects to PHP 8.1. Error related to https://github.com/mikecao/flight/issues/454#issue-1068799709

Can we merge this into master, perhaps creating v2.0 for PHP 7.4 > and keep v1.3.9 for older PHP versions...

FelipoAntonoff commented 2 years ago

@mikecao This is needed to update projects to PHP 8.1. Error related to #454 (comment)

Can we merge this into master, perhaps creating v2.0 for PHP 7.4 > and keep v1.3.9 for older PHP versions...

I think it's a good idea, created a new version with support for PHP 7.4 or newer like 8.1 and whoever wants old versions can use the previous version or even a branch as already suggested.

In Opencart, releases and tags are used, for example, in the new version under development, Readme warns the PHP version 8 or higher, including the Readme of current versions may even have a warning that those who want older PHP can use Release X.

fp07 commented 2 years ago

@mikecao This is needed to update projects to PHP 8.1. Error related to #454 (comment) Can we merge this into master, perhaps creating v2.0 for PHP 7.4 > and keep v1.3.9 for older PHP versions...

I think it's a good idea, created a new version with support for PHP 7.4 or newer like 8.1 and whoever wants old versions can use the previous version or even a branch as already suggested.

In Opencart, releases and tags are used, for example, in the new version under development, Readme warns the PHP version 8 or higher, including the Readme of current versions may even have a warning that those who want older PHP can use Release X.

I think this needs to be merged indeed. Composer will take care of versioning and compatibility. Hopefully the maintainer will merge this and create a new release tag 2.0+.

pierresh commented 2 years ago

Also, from a "marketing standpoint", it looks better to mention that the PHP minimum version is 7.4 or 8, rather than 5.3 ^^

mikecao commented 2 years ago

Hey everyone, I'll merge this soon and create a v2.0 version. Just been really busy.

chapani commented 2 years ago

Hey everyone, I'll merge this soon and create a v2.0 version. Just been really busy.

I am really waiting for this change. I upgraded to 8.1 but the only thing left is flightphp

fp07 commented 2 years ago

@masroore Is anything extra required for PHP 8.1 for this PR? Did you have a chance testing this on PHP 8.1? Since this request is since May, and PHP 8.1 is released recently.

masroore commented 2 years ago

@masroore Is anything extra required for PHP 8.1 for this PR? Did you have a chance testing this on PHP 8.1? Since this request is since May, and PHP 8.1 is released recently.

@fp07 This PR is now compatible with PHP 8.1. All tests are passing.

fp07 commented 2 years ago

@masroore Is anything extra required for PHP 8.1 for this PR? Did you have a chance testing this on PHP 8.1? Since this request is since May, and PHP 8.1 is released recently.

@fp07 This PR is now compatible with PHP 8.1. All tests are passing.

Fast work! Thanks, :) @mikecao ready? 👀

mu1f407 commented 2 years ago

I'm not really happy with this outcome. I think some changes, to be compatible with newest PHP versions, was necessary and I really appreciate possibility of using current version of PHPUnit. But I think this is too much opinionated. There is lot of unneeded changes like strict type checking (breaks #457), typed properties (breaks #456), final classes (breaks possibility of creating stubs in testing) and coding style (I find Yoda conditions harder to read).

I would prefer much lighter upgrade to solve PHP 8.1 compatibility with as little changes as needed and keeping as much compatibility with older PHP versions as possible.