PHPackages                             polyfills/pdo-mysql-subclass - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. polyfills/pdo-mysql-subclass

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

polyfills/pdo-mysql-subclass
============================

User-land PHP polyfill for PDO MySQL driver subclass.

v1.0.1(2y ago)048↓50%MITPHPPHP ^8.1

Since Jan 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/PHP-Polyfills/PDO-MySQL-Subclass)[ Packagist](https://packagist.org/packages/polyfills/pdo-mysql-subclass)[ RSS](/packages/polyfills-pdo-mysql-subclass/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

PDO MySQL Subclass Polyfill
===========================

[](#pdo-mysql-subclass-polyfill)

[![Latest Stable Version](https://camo.githubusercontent.com/bcecacef4b868a7584c250ce4d09e5e096db3dc779acf1303c7be0981b63e449/68747470733a2f2f706f7365722e707567782e6f72672f706f6c7966696c6c732f70646f2d6d7973716c2d737562636c6173732f76)](https://packagist.org/packages/polyfills/pdo-mysql-subclass) [![License](https://camo.githubusercontent.com/47eb55deb0422607b17409d84b72785a1e5378967d3ab43a61a1b26d33f18332/68747470733a2f2f706f7365722e707567782e6f72672f706f6c7966696c6c732f70646f2d6d7973716c2d737562636c6173732f6c6963656e7365)](https://packagist.org/packages/polyfills/pdo-mysql-subclass) [![PHP Version Require](https://camo.githubusercontent.com/246e584875f6145d941744524ae18363890fe15697f0378e303110b296d03ca5/68747470733a2f2f706f7365722e707567782e6f72672f706f6c7966696c6c732f70646f2d6d7973716c2d737562636c6173732f726571756972652f706870)](https://packagist.org/packages/polyfills/pdo-mysql-subclass) [![CI](https://github.com/PHP-Polyfills/PDO-MySQL-Subclass/actions/workflows/ci.yml/badge.svg)](https://github.com/PHP-Polyfills/PDO-MySQL-Subclass/actions/workflows/ci.yml/badge.svg)

Provides user-land PHP polyfills for the MySQL subclass provided by PHP 8.4.

Supports PHP 8.1, 8.2, and 8.3. On PHP 8.4 and later, this polyfill is not necessary. Requires `pdo_mysql` extension compiled with `mysqlnd` (which is the default and common approach).

It is possible and safe to require this polyfill on PHP 8.4 and later. This polyfill class is autoloadable; on PHP 8.4 and later, PHP will *not* autoload this polyfill because it's declared natively.

For more information, see [`PdoMysql`](https://php.watch/versions/8.4/pdo-driver-subclasses#PdoMysql) on [`PHP 8.4: PDO Driver-specific sub-classes: MySQL`](https://php.watch/versions/8.4/pdo-driver-subclasses)

Installation
------------

[](#installation)

```
composer require polyfills/pdo-mysql-subclass
```

Usage
-----

[](#usage)

Use the provided `PdoMysql` class to replace `PDO` MySQL connections.

```
$mysqlConnection = new PdoMysql(
    'mysql:host=localhost;dbname=phpwatch;charset=utf8mb4;port=33066',
    '',
    '',
);
```

```
$mysqlConnection = PdoMysql::connect(
    'mysql:host=localhost;dbname=phpwatch;charset=utf8mb4;port=33066',
    '',
    '',
);
```

This polyfill adds class-constants to `PdoMysql` class to match all of the `PDO::MYSQL_` constants. For example, `PDO::MYSQL_ATTR_SSL_CERT` is identical to `PdoMysql::ATTR_SSL_CERT`.

### Features not implemented

[](#features-not-implemented)

- `PDO::connect`: This method cannot be polyfilled because it's an existing PHP class that user-land PHP classes cannot modify.
- `PdoMysql::getWarningCount`: This method is not implemented in the polfyill.

Contributions
-------------

[](#contributions)

Contributions are welcome either as a GitHub issue or a PR to this repo.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

853d ago

Major Versions

v0.3.0 → v1.0.02024-01-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/1703f88c1f225e3fadff28458e81328f86668d9631a8c489f45ea1aaebe12df2?d=identicon)[Ayesh](/maintainers/Ayesh)

---

Top Contributors

[![Ayesh](https://avatars.githubusercontent.com/u/811553?v=4)](https://github.com/Ayesh "Ayesh (18 commits)")

---

Tags

compatmysqlpdophpphp8php84polyfillscompatibilitypolyfillshimpolyfillscompatphp84phpwatch

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/polyfills-pdo-mysql-subclass/health.svg)

```
[![Health](https://phpackages.com/badges/polyfills-pdo-mysql-subclass/health.svg)](https://phpackages.com/packages/polyfills-pdo-mysql-subclass)
```

###  Alternatives

[symfony/polyfill-mbstring

Symfony polyfill for the Mbstring extension

7.8k1.2B515](/packages/symfony-polyfill-mbstring)[symfony/polyfill-php72

Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions

4.8k674.7M31](/packages/symfony-polyfill-php72)[symfony/polyfill-util

Symfony utilities for portability of PHP codes

1.3k123.9M7](/packages/symfony-polyfill-util)[symfony/polyfill-intl-idn

Symfony polyfill for intl's idn\_to\_ascii and idn\_to\_utf8 functions

3.4k774.6M90](/packages/symfony-polyfill-intl-idn)[symfony/polyfill-intl-normalizer

Symfony polyfill for intl's Normalizer class and related functions

2.1k830.2M36](/packages/symfony-polyfill-intl-normalizer)[symfony/polyfill-php73

Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions

2.4k581.8M67](/packages/symfony-polyfill-php73)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
