-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8.3 Compatibility #4552
Comments
Regarding the reflection deprecation, that point seems valid. Those lines could probably be replaced with:
Regarding SQLite3 enableExceptions(), I don't see that being used anywhere in framework code? |
PHP 8.3 introduces several deprecations that impact the current codebase. Specifically:
Proposed Changes
Implementation Plan
Hope this helps out! Regards. |
@TheGithubDev was the post above generated with AI? Is SQLite3 enableExceptions() used anywhere in framework code? |
Hi. When will PHP 8.3 support be released for Yii 1.1? Thank you. |
@christophwariszlovich You can use #4553 for now and please report any new issues you can find :) |
Issue that I found:
Code causes this error:
|
@christophwariszlovich That doesn't look like a PHP 8.3 error at first sight, looks like an application-specific error with your Booking class default scopes or dbcriteria. You probably get the same error message on earlier PHP versions. |
@marcovtwout We have the app running on PHP 5.6 and PHP 8.0.18 running where I dont get the error, we were looking to upgrade to 8.3 and encountered this error. Will check if its a possible problem on our side. Thank you. |
@marcovtwout Thank you for pointing me in the right direction. There was a defaultScope function in the model but it didnt return anything! |
@marcovtwout I found an issue with the function initConnection in CDbConnection class. As of PHP 8.1 the MySQL driver will convert int and float to the PHP data types (see here: https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.pdo.mysql). In Yii 1.1 there is already code for this but it only applies to sqlite driver:
For our application we need the values to be strings, so I overwrote the function in an own class. But I think this should be fixed, as this might legacy code to break when using PHP >= 8.1. Thank you. |
@christophwariszlovich We are using the same behavior here as Yii2 is doing. I'm not entirely sure why, but Yii2 only applies ATTR_STRINGIFY_FETCHES for sqlite. One could argue it's not really a bug/regression but more of a typing improvement in the underlying PDO library. If your application wants the old behavior, you can implement it like this: |
What steps will reproduce the problem?
PHP Deprecated the following features/functions in their release of 8.3:
https://www.php.net/manual/en/migration83.deprecated.php
Saner Increment/Decrement operators
Reflection
Calling ReflectionProperty::setValue() with only one parameter is deprecated. To set static properties, pass null as the first parameter.
Possibly impacted code:
SQLite3
Using exceptions is now preferred, warnings will be removed in the future. Calling SQLite3::enableExceptions(false) will trigger a deprecation warning in this version.
How can we plan PHP 8.3 compatibility?
Additional info
The text was updated successfully, but these errors were encountered: