msphpsql icon indicating copy to clipboard operation
msphpsql copied to clipboard

PHP 8.5 (compilation) support

Open stancl opened this issue 2 months ago • 3 comments

Since https://github.com/php/php-src/pull/17741, dbh->error_mode is stored as uint8_t. We cast the value to pdo_error_mode for the assignment to work.

Since https://github.com/php/php-src/pull/17742, query_stmt_zval has been replaced by query_stmt_obj. The diff in the linked PR shows the new destructor usage. We follow that same usage in this commit.


A few notes:

  • I have limited experience with php-src, so please review with care. The context in the linked PRs should be sufficient.
  • I did not guard the changes in pdo_dbh.cpp with PHP version checks. I assume (but do not know) that casting from pdo_error_mode to pdo_error_mode (in PHP <= 8.4) shouldn't emit any compiler warnings.
  • Initially I used just (pdo_error_mode) dbh->error_mode but noticed that existing code uses static_cast. I don't have experience with C++ but assume this should be correct.

The changes are confirmed to compile for me locally, but this should be confirmed in CI.

stancl avatar Oct 19 '25 21:10 stancl

@microsoft-github-policy-service agree

stancl avatar Oct 19 '25 21:10 stancl

It compiles under Windoiws (VS17). I do not have a running sqlsrv database, so I did not run the tests.

Jan-E avatar Oct 22 '25 01:10 Jan-E

Hello, When will this PR be integrated? This is the only thing delaying some of us from upgrading.

theoaksoft avatar Dec 10 '25 08:12 theoaksoft