1--TEST--
2Bug #63921 sqlite3::bindvalue and relative PHP functions aren't using sqlite3_*_int64 API
3--EXTENSIONS--
4sqlite3
5--SKIPIF--
6<?php
7if (PHP_INT_SIZE > 4) die('skip 32-bit only'); // skip for 64bit builds - there is another test for that
8?>
9--FILE--
10<?php
11$num = PHP_INT_MAX; // 32 bits
12$conn = new sqlite3(':memory:');
13$conn->query('CREATE TABLE users (id INTEGER NOT NULL, num INTEGER NOT NULL, PRIMARY KEY(id))');
14
15$stmt = $conn->prepare('insert into users (id, num) values (:id, :num)');
16$stmt->bindValue(':id', 1, SQLITE3_INTEGER);
17$stmt->bindValue(':num', $num, SQLITE3_INTEGER);
18$stmt->execute();
19
20$stmt = $conn->query('SELECT num FROM users');
21$result = $stmt->fetchArray();
22
23var_dump($num,$result[0]);
24
25?>
26--EXPECT--
27int(2147483647)
28int(2147483647)
29