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