-
Notifications
You must be signed in to change notification settings - Fork 35
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
pgsql back-end resource handling broken on PHP 8.1 #37
Comments
@MarkMaldaba Thank you. I´ll have a look at it. |
Any news on this ? we just hit this issue and rather keep pear::db than rewrite code that uses it for the moment. |
I'm just a user and got a workaround for this problem. It is to replace |
I´m sorry, but i´m very busy at the moment. |
Sure. I made a PR. Please review it when you are good and ready. Thanks. |
Sorry, I found some mistakes. I closed the PR and will try it again. |
@tmitanitky I was wondering what mistakes did you found that led you to remove your PR ? |
Since PHP 8.1, the postgres connection methods now return a PHP object rather than a resource.
From https://php.watch/versions/8.1/PgSQL-resource:
In PEAR::DB, the
DB_pgsql
class is implemented on the assumption that the returned result is a PHPresource
reference. In particular, the implementation type-casts the result to an integer which is used as an array index, which is no longer possible with the object implementation. In addition, there are checks usingis_resource()
which will fail on PHP 8, as this function only returns true for theresource
implementation.The class needs to be updated to handle both implementations, in order to support older PHP versions as well as continuing to run on PHP >= 8.1.
The text was updated successfully, but these errors were encountered: