Download src/php/php-src/ext/pdo_sqlite/tests/bug_63916-2.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 726 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_sqlite/tests/bug_63916-2.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pdo_sqlite/tests/bug_63916-2.phpt
-
curl -L -o bug_63916-2.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_sqlite/tests/bug_63916-2.phpt
726 Bytes
| --TEST-- | |
| Bug #63916 PDO::PARAM_INT casts to 32bit int internally even on 64bit builds in pdo_sqlite | |
| --EXTENSIONS-- | |
| pdo_sqlite | |
| --SKIPIF-- | |
| if (PHP_INT_SIZE > 4) die('skip 32-bit only'); | |
| --FILE-- | |
| $num = PHP_INT_MAX; // 32 bits | |
| $conn = new PDO('sqlite::memory:'); | |
| $conn->query('CREATE TABLE users (id INTEGER NOT NULL, num INTEGER NOT NULL, PRIMARY KEY(id))'); | |
| $stmt = $conn->prepare('insert into users (id, num) values (:id, :num)'); | |
| $stmt->bindValue(':id', 1, PDO::PARAM_INT); | |
| $stmt->bindValue(':num', $num, PDO::PARAM_INT); | |
| $stmt->execute(); | |
| $stmt = $conn->query('SELECT num FROM users'); | |
| $result = $stmt->fetchAll(PDO::FETCH_COLUMN); | |
| var_dump($num,$result[0]); | |
| --EXPECT-- | |
| int(2147483647) | |
| int(2147483647) | |