Upping requirements to PHP 7.4?

(Alexander Makarov) #1

7.4 was released today and we may consider using it as a requirement for Yii 3.

What we can benefit from new features:

  • Typed properties - would simplify checks overall and will make code stricter. Potentially we can adopt typed DTOs.
  • Limited return type covariance and argument type contravariance - would allow to seamlessly add types for PSR interfaces (may not be needed since PHP-FIG is planning to update interfaces).
  • Ability to throw __toString() exceptions - would simplify error handler and make widgets more reliable.

Another reason is the fact that 7.2 EOLed: https://www.php.net/supported-versions.php

  • Go for 7.4
  • Stay with 7.2

0 voters

(roxblnfk) #2

Among the features i would note the preloading

Currently, not all hosting companies support PHP7.3, let alone PHP7.4
I think we need to look into the future to be sure that at the time of release most hosts will supported PHP7.4

(Viktor) #3

I think there is no reason to use not supported version as a requirement. PHP 7.3 will be the oldest version that is still actively supported when Yii 3 will be released. I suggest to use 7.3 as a minimal requirement.
And on the other hand we have some features of php 7.4 like typed properties which will accelerate framework development and reduce bugs. And it is the reason to use 7.4 as a minimal requirement.

As a conclusion I suggest to use 7.4 as a requirement because the most of projects built on top of Yii 3 will be new projects not limited with old php versions.

(Viktor) #4

I’m now moving to the company with php 7.1 and monolith with Yii2. They want to update php version, and I’ll suggest to use php 7.4 and to separate some functionality into services built with Yii3.

(Wilmer Arambula) #5

It would be ideal, have as a minimum version of php 7.4, and update yii3 with the new features.

(mahmud) #6

I am for raising requirements to php 7.4. Yii 3 is still in development and until it becomes stable, the latest version of php will be used everywhere. It will not be like with yii 2 when the framework has become stable, the minimum supported version of php 5.4 is out of date.

(Alexander Makarov) #7

I’ve added a poll.

(Talismanfr) #8

No need to repeat the mistake Yii2. I vote Php 7.4 and then php8.

(WEBDeveloperZBK) #9

Hi! I wanted to vote for PHP 7.4, but mistakenly clicked not there :grin: (slow rendering)

(mahmud) #10

@qibite hide the result and vote again

(WEBDeveloperZBK) #11

Thanks, I think this button need to rename “delete vote” for example.

(Knight Yoshi) #12

Since Yii3 won’t be out for a while that will give 7.4 more time for adoption and will push it to last longer. 7.4 or bust

(Fsb) #13

There’s good stuff in 7.4. In addition to what’s already mentioned, short (arrow) function syntax would be useful for Yii core and users.

(Alexander Makarov) #14

And… we’ve migrated. No features are used yet but some polyfills and special cases were already deleted.