xref: /PHP-8.3/ext/pdo/tests/pecl_bug_5809.phpt (revision 74859783)
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 test (id int NOT NULL, PRIMARY KEY (id))");
19$db->exec("INSERT INTO test (id) VALUES (1)");
20
21$values = array(1);
22var_dump($values);
23$stmt = $db->prepare('SELECT * FROM test WHERE id = ?');
24$stmt->execute($values);
25var_dump($values);
26?>
27--EXPECT--
28array(1) {
29  [0]=>
30  int(1)
31}
32array(1) {
33  [0]=>
34  int(1)
35}
36