[php-src] Issue #25021: SQLite createFunction corrupts large integers
| From: | mvorisek | Date: | Wed, 28 Oct 2026 21:18:53 +0000 |
| Subject: | [php-src] Issue #25021: SQLite createFunction corrupts large integers | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-253905@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/25021
Author: mvorisek
### Description
The following code:
```php
<?php
$db = new PDO('sqlite::memory:');
$db->sqliteCreateFunction('cust', function ($v) {
var_dump($v);
return $v;
}, 1);
$sth = $db->prepare('SELECT :a direct, cust(:a) fx');
$sth->bindValue('a', 1_234_000_000_000, PDO::PARAM_INT);
$sth->execute();
$result = $sth->fetch(PDO::FETCH_ASSOC);
var_dump($result);
```
Resulted in this output:
```
int(1344386048)
array(2) {
["direct"]=>
int(1234000000000)
["fx"]=>
int(1344386048)
}
```
But I expected this output instead:
```
int(1234000000000)
array(2) {
["direct"]=>
int(1234000000000)
["fx"]=>
int(1234000000000)
}
```
Please fix at the lowest branch possible as there is no client workaround.
### PHP Version
```plain
any
```
### Operating System
any