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