xref: /PHP-8.4/ext/pdo/tests/pecl_bug_5809.phpt (revision f4a5db3e)
1--TEST--
2PDO Common: PECL Bug #5809 (PDOStatement::execute(array()) changes param)
3--EXTENSIONS--
4pdo
5--SKIPIF--
6<?php
7$dir = getenv('REDIR_TEST_DIR');
8if (false == $dir) die('skip no driver');
9require_once $dir . 'pdo_test.inc';
10PDOTest::skip();
11?>
12--FILE--
13<?php
14if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/');
15require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
16$db = PDOTest::factory();
17
18$db->exec("CREATE TABLE test5809 (id int NOT NULL, PRIMARY KEY (id))");
19$db->exec("INSERT INTO test5809 (id) VALUES (1)");
20
21$values = array(1);
22var_dump($values);
23$stmt = $db->prepare('SELECT * FROM test5809 WHERE id = ?');
24$stmt->execute($values);
25var_dump($values);
26?>
27--CLEAN--
28<?php
29require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
30$db = PDOTest::factory();
31PDOTest::dropTableIfExists($db, "test5809");
32?>
33--EXPECT--
34array(1) {
35  [0]=>
36  int(1)
37}
38array(1) {
39  [0]=>
40  int(1)
41}
42