xref: /PHP-8.1/ext/sqlite3/tests/bug71049.phpt (revision 7f2f0c00)
1--TEST--
2Bug #71049 (SQLite3Stmt::execute() releases bound parameter instead of internal buffer)
3--EXTENSIONS--
4sqlite3
5--FILE--
6<?php
7
8require(__DIR__ . '/new_db.inc');
9
10$db->exec('CREATE TABLE test (age INTEGER, id STRING)');
11
12$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC");
13$foo = "alive" . chr(33);
14$stmt->bindParam(1, $foo, SQLITE3_BLOB);
15$results = $stmt->execute();
16var_dump($foo);
17$db->close();
18?>
19--EXPECT--
20string(6) "alive!"
21