Trying to test php82 branch

I’m upgrading a yii2 project to PHP8.2
I see that the latest release of Yii is 2.0.47 which isn’t ready for PHP8.2
There is a branch php82
I want to use the php82 branch, and if I find any problems I can help out with a pull request.

I’ve forked github yii2
created new branch dev-php82
updated composer.json:

"repositories": [
        "type": "git",
        "url": ""
"require": {
    "php": ">=8.2.1",
    "yidas/yii2-bower-asset": "~2.0.5",
    "yiisoft/yii2": "dev-php82@dev",

run composer update:

  • Root composer.json requires yiisoft/yii2 dev-php82@dev, found yiisoft/yii2[dev-master, 2.0.0-alpha, …, 2.1.x-dev, 3.0.x-dev] but it does not match the constraint.

That’s because the composer package points to a sub-split repo, yiisoft/yii2-framework and there’s no such branch.

You can checkout yiisoft/yii2 via git and then point your index.php to use it instead of a vendor one.

Thanks that works on my local dev install.
pushing that up to a server using git — arghh submodules

The problem I’m seeing as that the PK of a model has changed from string to integer (on windows) under PHP8.2 vs PHP8.0.
Gii doesn’t include the PK in the rules so there is no explicit typing in the PHP model.

I’ve now compared PHP8.0 with PHP8.2 on both linux and windows.
integer PKs have changed from string (PHP8.0) to integer (PHP8.2) on both platforms.
In mysql there were always integer. Yii models presented them as strings up to now.
It’s breaking a lot of code!!!
This happened on the current release 2.0.47 as well, so it’s not the php82 branch doing it, it’s PHP8.2.

Interesting. Would you please submit an issue to Sign in to GitHub · GitHub providing some details? That’s definitely a thing to fix before next release.

1 Like

Getting a mixture of /vendor/yii and the 8.2 branch.
Not sure if that makes it a good test.
So far no errors with php8.2

@samdark any reason php82 was not named in a composer installable way?
I was trying to test it, but the efforts to just make it install is not worthy it

What do you mean by “was not named in a composer installable way”?

Can’t install the PHP8.2 branch by editing composer.json

Yes. Because Yii2 isn’t installed from yiisoft/yii2 but from yiisoft/yii2-framework which is git subsplit and does not have all these branches.

Check out yiisoft/yii2 separtely and point your index.php there for now.

Excuse my lousy language. I mean some sort of alpha release that can be installable by simply adding it to composer file that juggling around. It took me few minutes to change PHP to 8.1 after long time of trying to install this branch.

Yes. The sub-split wasn’t a great idea back then. That’s why we did Yii3 differently but it’s too late to change it for Yii2.

I guess it will be hard to test this branch as many cannot really afford the cost. What about merging it to master so that we can easily test it? I have a quiet big app that can do a good amount of testing. But will have to wait until it is merged to master

Not until the unit tests pass. Before that we’re sure that 8.2 doesn’t work well so there’s no sense in merging to master.

1 Like