[php-src] Issue #15182: PDO OCI binds boolean false as NULL
| From: | morozov | Date: | Wed, 31 Jul 2024 15:17:28 +0000 |
| Subject: | [php-src] Issue #15182: PDO OCI binds boolean false as NULL | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247408@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/15182
Author: morozov
### Description
The following code:
```php
<?php
$conn = new
PDO('oci:dbname=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=XE)))',
'system', 'oracle');
$stmt = $conn->prepare('SELECT ?, ? FROM DUAL');
$stmt->bindValue(1, true, PDO::PARAM_BOOL);
$stmt->bindValue(2, false, PDO::PARAM_BOOL);
$stmt->execute();
var_dump($stmt->fetchAll(PDO::FETCH_NUM));
```
Resulted in this output:
```
array(2) {
[0] =>
string(1) "1"
[1] =>
NULL
}
```
But I expected this output instead:
```
array(2) {
[0] =>
string(1) "1"
[1] =>
string(1) "0"
}
```
### PHP Version
PHP 8.3.8
### Operating System
_No response_