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