CodeIgniter icon indicating copy to clipboard operation
CodeIgniter copied to clipboard

php 8.5: deprecated PDO constants and functions

Open jamieburchell opened this issue 3 months ago • 1 comments

As per upcoming PHP 8.5 deprecations

There are a huge number of driver-specific constants and methods defined on the main PDO class; as examples, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, PDO::pgsqlCopyFromArray(). PHP 8.4 introduced driver-specific subclasses of PDO, and all of these are now defined in those subclasses.

PHP 8.5 deprecates usage of the PDO constants and methods in favor of those.

For interested parties there's a preliminary fix in this branch which has been lightly tested with PDO for MySQL (I usually use the mysqli driver). This change will require PHP >= 8.4.

The patch also returns the respective subclass where available, instead of the generic PDO class.

jamieburchell avatar Oct 22 '25 14:10 jamieburchell

Applied to my fork. Thanks.

NielBuys avatar Oct 23 '25 22:10 NielBuys