Skip to content

Conversation

@onlime
Copy link
Contributor

@onlime onlime commented Nov 22, 2025

This is a follow-up to #57835. That PR used a PHP_VERSION_ID >= 80500 check, but this can fail on minimal or custom PHP installations where the Pdo\Mysql driver-specific PDO subclass is not available.

As recommended by @phildawson-gravity in #57141 (comment), feature-detection is more reliable. This update switches the condition to defined('Pdo\Mysql::ATTR_SSL_CA'), ensuring compatibility across environments regardless of how PDO extensions are compiled.


Behavior of different PHP versions:

# PHP 8.4
> Pdo\Mysql::ATTR_SSL_CA
= 1009
> PDO::MYSQL_ATTR_SSL_CA
= 1009

# PHP 8.5
> Pdo\Mysql::ATTR_SSL_CA
= 1008
> PDO::MYSQL_ATTR_SSL_CA
   Deprecated: Constant PDO::MYSQL_ATTR_SSL_CA is deprecated since 8.5, use Pdo\Mysql::ATTR_SSL_CA instead
= 1008

# PHP 8.5 without Pdo\Mysql
> Pdo\Mysql::ATTR_SSL_CA
   Error  Class "Pdo\Mysql" not found.

@crynobone
Copy link
Member

We don't need this. As explained in the PR that is temporarily until symfony/polyfill#549 get merged.

The only reason the changes was made in the framework and not skeleton is only to allow our team to update 1st party packages to be tested with PHP 8.5.

@onlime onlime closed this Nov 22, 2025
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