[php-src] Issue #12969: Unable to check PDO::ATTR_STRINGIFY_FETCHES configuration
| From: | janedbal | Date: | Mon, 18 Dec 2023 13:13:53 +0000 |
| Subject: | [php-src] Issue #12969: Unable to check PDO::ATTR_STRINGIFY_FETCHES configuration | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246070@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12969
Author: janedbal
### Description
The following code:
```php
<?php
$pdo = new PDO('mysql:host=mysql;port=3306', 'root', 'secret');
var_dump(
$pdo->getAttribute(PDO::ATTR_STRINGIFY_FETCHES)
);
```
Resulted in this output:
```
Fatal error: Uncaught PDOException: SQLSTATE[IM001]: Driver does not support this function: driver
does not support that attribute in /app/pdo.php on line 3
```
But I expected this output instead:
```
int(0);
```
It seems like **I cannot verify how PDO is configured regarding this option**. When
$pdo->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true) is used, true is
returned and the behaviour changes. This behaviour applies for at least mysql, pgsql and sqlite.
Full dockerized replication repository: https://github.com/janedbal/php-pdo-get-attribute-bug
### PHP Version
PHP 8.3.0
### Operating System
_No response_