Skip to content

odbc: support for php 8.4 changes #47

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

Draft
wants to merge 8 commits into
base: trunk
Choose a base branch
from
Draft

Conversation

DanCld
Copy link
Contributor

@DanCld DanCld commented May 2, 2025

This is a PR following the issue reported in #45 regarding using internal opaque classes instead of resources starting with PHP 8.4.

DanCld added 8 commits March 21, 2025 20:18
As per https://php.watch/versions/8.1/PgSQL-resource, PostgreSQL
extension has moved away from resource objects and is now
returning opaque classes (PgSQL\Connection, Result, Lob).

These classes no longer provide default conversions to (int), so
a different approach is required, while maintaining compatibility
to older PHP versions.
My previous commit did not check for the right result structure
before raising an exception. While looking into this, I have found
a deprecation issue with Postgresql server versions >= 12 that
needed fixing as well (adsrc column was removed).

Context and recommended replacement: https://www.postgresql.org/docs/12/release-12.html#:~:text=obsolete%20pg_attrdef.-,adsrc,-column%20(Peter%20Eisentraut
This completes the decision tree related to handling pg_() internal functions return types and function availability based on PHP versions. The statement is not normally expected to be executed with any current or historical PHP version, but having it seems like a good idea, at least for completeness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant