Upping requirements to PHP 7.4?

I’ve added a poll.

2 Likes

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

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

@qibite hide the result and vote again

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

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

3 Likes

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.

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

https://www.yiiframework.com/status/3.0

Up to 7.4 for what? I think nobody wants to rewrite the whole codebase introducing typed properties and return types and debug the whole thing afterwards. Dude, Yii3 was making good progress. OK well, let’s start again from scratch.

There’s no need to rewrite anything. Version bump allows:

  1. Deleting polyfills and simplify error handling.
  2. Can design widgets to use __toString() for better syntax. Previously it was a really bad decision.
  3. Care not about legacy versions of PHP that would reach EOL soon.

Syntax updates do not matter much but these could be done using one of the static analysis + replacement tools in almost no time.

OK, that would mean rather small changes.
But introducing strict data types is no easy task. I did this one time for a bigger Groovy program. I had to fix runtime errors for month. I regret starting the whole refactoring project in the first place. Runtime improvements were reather small. You never know when a type mismatch error will be introduced, especially when supporting mudules and extentions that access the framework’s API.

Strict types were mostly already there before 7.4 was released so no, this work is already done.

Most of the db stuff and some older files are not in strict type mode or show typed properties / typed properties 2.0. Will all these remaining files be updated and Yii3 will than become 100% strict typed?

db stuff is currently postponed. We’re going to release alpha with https://github.com/yiisoft/yii-cycle. What older files do you refer to?

Yiisoft DI package requires PHP 8.0 now, it seems. :stuck_out_tongue:

SlimPHP v4 requires PHP 7.4, according to their docs. Installation - Slim Framework

What are you trying to say?

That I’m forced to use SlimPHP :man_facepalming:

Did you try to upgrade to 8.0 and see how many things break?
Unless you enjoy SlimPHP, I would try to update my PHP version in test environment and see

Highly sensitive and sadly understaffed project, not possible until next year at least, which is too late.

I mean, you just make a copy and upgrade PHP version and see how it works. One time I was surprised that I had very few things to tweak and make it work with PHP8.3. But that was Yii2. You might want to give it a go!