Skip to content

Fix php85 mysql attr constant#2405

Open
schlndh wants to merge 2 commits intocakephp:0.xfrom
schlndh:fix-php85MysqlAttrConstant
Open

Fix php85 mysql attr constant#2405
schlndh wants to merge 2 commits intocakephp:0.xfrom
schlndh:fix-php85MysqlAttrConstant

Conversation

@schlndh
Copy link

@schlndh schlndh commented Feb 27, 2026

PHP 8.4 introduced driver-specific PDO subclases (e.g. \PDO\Mysql). PHP 8.5 deprecated \PDO::MYSQL_* (etc) constants.

I'm using phinx with mysql_attr_multi_statements: 0 and on PHP 8.5 I get

PHP Deprecated:  Constant PDO::MYSQL_ATTR_MULTI_STATEMENTS is deprecated since 8.5, use Pdo\Mysql::ATTR_MULTI_STATEMENTS instead in vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php on line 154

This PR should fix it.

I checked the other drivers as well, and the only other one with similar functionality is the SqlServerAdapter. However, that one doesn't seem to have the a PDO subclass.

@schlndh schlndh force-pushed the fix-php85MysqlAttrConstant branch from 878f9c3 to c4a4b2d Compare February 27, 2026 10:17
@schlndh schlndh force-pushed the fix-php85MysqlAttrConstant branch from c4a4b2d to 7f6816e Compare February 27, 2026 10:24
@remluben
Copy link

remluben commented Mar 2, 2026

+1 😄 - I recently ran into these as well. Having this merged would be nice. Many thanks for suggesting the changes.

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.

2 participants