1--TEST--
2PDO PgSQL PDOStatement::debugDumpParams() with emulated prepares
3--EXTENSIONS--
4pdo_pgsql
5--SKIPIF--
6<?php
7require __DIR__ . '/config.inc';
8require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
9PDOTest::skip();
10?>
11--FILE--
12<?php
13require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
14$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
15$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
16
17$stmt = $db->prepare('SELECT :bool, :int, :string, :null');
18$stmt->bindValue(':bool', true, PDO::PARAM_BOOL);
19$stmt->bindValue(':int', 123, PDO::PARAM_INT);
20$stmt->bindValue(':string', 'foo', PDO::PARAM_STR);
21$stmt->bindValue(':null', null, PDO::PARAM_NULL);
22$stmt->execute();
23
24var_dump($stmt->debugDumpParams());
25
26?>
27--EXPECT--
28SQL: [34] SELECT :bool, :int, :string, :null
29Sent SQL: [28] SELECT 't', 123, 'foo', NULL
30Params:  4
31Key: Name: [5] :bool
32paramno=-1
33name=[5] ":bool"
34is_param=1
35param_type=2
36Key: Name: [4] :int
37paramno=-1
38name=[4] ":int"
39is_param=1
40param_type=1
41Key: Name: [7] :string
42paramno=-1
43name=[7] ":string"
44is_param=1
45param_type=2
46Key: Name: [5] :null
47paramno=-1
48name=[5] ":null"
49is_param=1
50param_type=0
51NULL
52