Roave/BetterReflection

Supporting PHP 7

WinterSilence opened this issue · 10 comments

Need copy common features to branch 4.x (PHP 7).

Reasons:

  1. some new features in branch 5.x not related directly to PHP 8
  2. PHP 8 using only in 6-10%

You don't need to backport features; BR 5.1.x running in PHP 8 can analyse all older versions of PHP code, so it doesn't matter what version of PHP the codebase being analysed is, as long as the version of PHP running BR is PHP 8+

@asgrim

PHP 8 using only in 6-10%

i.e. in 90-94% of cases can't use BetterReflection

@asgrim

PHP 8 using only in 6-10%

i.e. in 90-94% of cases can't use BetterReflection

I repeat; the codebase being analysed, regardless of what PHP version the codebase needs, can still be analysed by BR if you run BR under PHP 8. I expect you don't even need to install PHP 8, you can probably just run it in a Docker container or something (not something we provide).

@asgrim if server use PHP7 you can't install BetterReflection 5.x, but 4.x don't contain some common features added in 5.x

@asgrim if server use PHP7 you can't use BetterReflection 5.x

BR is not designed to run in production, so it does not matter what version of PHP you run on your server/deployment environments. Specifically, on the front page of the README, it says:

Better Reflection is NOT suited to runtime usage, since performance is much worse than PHP built-in reflection.
If you do not want to do anything that native PHP reflection can't do, then just use native PHP reflection! The "Better"
in Better Reflection refers to feature, not speed!

@asgrim "NOT suited to runtime usage" not same to "not designed to run in production"

@asgrim for example, I'm using BR for generates sitemap by controller actions and autocomplete for template editor in back-end

Closing: PHP 7 runtime aupport is NOT coming.

In fact, 8.0 support will be dropped when we decide to rely on 8.1 features.

Focus on upgrading your stack, please: you will have to do it anyway.

Alternatively, just run BetterReflection 4.x, which works fine on PHP 7.

@Ocramius

some new features in branch 5.x not related directly to PHP 8

@Ocramius

some new features in branch 5.x not related directly to PHP 8

Please stop quoting things you have already said, we already read the issue description.

I'm afraid new features are only available in the newer branches, and we do not plan to backport them.

If you must run PHP 7, then please use the 4.x series, which will continue to receive security fixes for now.

But again: I reiterate, you can run BR in PHP 8 to perform analysis on a PHP 7 codebase already. It's up to you how you want to make that happen.

If you would like consulting on how to actually do that for your situation, please contact me and I am happy to help you develop your solution, but that is paid support only.