|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #52384 PDOStatement::debugDumpParams does not emit the bind parameter value
Submitted: 2010-07-20 23:43 UTC Modified: 2016-07-25 15:28 UTC
Avg. Score:4.3 ± 0.9
Reproduced:132 of 134 (98.5%)
Same Version:49 (37.1%)
Same OS:45 (34.1%)
From: jonah dot harris at gmail dot com Assigned: bishop (profile)
Status: Closed Package: PDO related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
40 + 39 = ?
Subscribe to this entry?

 [2010-07-20 23:43 UTC] jonah dot harris at gmail dot com
Per the PDO documentation, PDOStatement::debugDumpParams should emit the bind parameter value.  Currently however, it does not.  Attached is a patch for 5.2 (which also applies cleanly to 5.3), which emits the bind parameter value.

Test script:
$dbh = new PDO("sqlite:test.sdb");
$calories = (int) 150; /* Force a type conversion to string */
$colour = 'red';
$sth = $dbh->prepare('SELECT 1 WHERE 1 = :calories AND 2 = :colour');
if ($sth->bindParam(':calories', $calories, PDO::PARAM_INT) !== true)
    die('die on ' . __LINE__. "\n");
if ($sth->bindValue(':colour', $colour, PDO::PARAM_STR) !== true)
    die('die on ' . __LINE__. "\n");


Expected result:
With Patch:

SQL   : [len = 44] SELECT 1 WHERE 1 = :calories AND 2 = :colour
Params: 2
Key: Name: [9] :calories
name=[9] ":calories"
Key: Name: [7] :colour
name=[7] ":colour"

Actual result:
SQL: [44] SELECT 1 WHERE 1 = :calories AND 2 = :colour
Params:  2
Key: Name: [9] :calories
name=[9] ":calories"
Key: Name: [7] :colour
name=[7] ":colour"


pdo_debugDumpParams_p3.txt (last revision 2010-07-20 21:44 UTC by jonah dot harris at gmail dot com)

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-29 01:22 UTC] cdotgutierrez at gmail dot com
I am seeing the same issue on PHP 5.3.3 on OSX. I've tried it using the same
test script that is provided in the original ticket.
 [2011-09-15 11:54 UTC] php at nedge2k dot com
problem also exists in php 5.3 for windoze
 [2013-05-29 07:41 UTC] cedric dot bethencourt at gmail dot com
same problem with PHP 5.3.3 on Linux Debian
 [2014-02-02 10:12 UTC] bugs dot php dot net at dotancohen dot com
I can confirm this issue on Ubuntu Server 12.04 with PHP 5.3.10. The output of debugDumpParams() does not display the value of bound parameters.
 [2015-06-06 02:00 UTC] felipsmartins at gmail dot com
I run into the same issue. At 2015-06-05
 [2015-10-31 22:17 UTC] knl at bitflop dot com
The problem still exist in PHP 5.6.14 on Debian Jessie.

Could we please get this fixes ASAP!
 [2015-12-07 18:07 UTC] cjromb at gmail dot com
It's still an issue in 5.6.16


    $stmt = $dbh->prepare("SELECT * FROM clients WHERE name LIKE :name");

    $name = "%Boy%";

    $stmt->bindParam(':name',$name, PDO::PARAM_STR);

        echo "It executed.  Here's what it executed";
     endif;  // shortened for this comment


It executed.  Here's what it executedSQL: [43] SELECT * FROM clients WHERE name LIKE :name
Params:  1
Key: Name: [5] :name
name=[5] ":name"

^^ Note no param value!
 [2016-05-23 16:32 UTC] aaron at acwpd dot com
Confirming this is still present on PHP on Ubuntu  ubuntu1404-x64 (via vagrant box puphpet/ubuntu1404-x64)
 [2016-07-09 11:42 UTC]
Current behavior confirmed: <>.

> Could we please get this fixes ASAP!

In a strict sense this is not a bug, so it can't be fixed. The
suggested improvement seems to be reasonable, though. A Github PR
for PHP-7.1 including a PHPT (and/or fixing existing PHPTs) would
certainly be welcome.
 [2016-07-11 18:09 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: bishop
 [2016-07-12 09:43 UTC]
-Status: Assigned +Status: Feedback
 [2016-07-12 09:43 UTC]
Please try using this snapshot:
For Windows:

 [2016-07-12 14:12 UTC]
-Status: Feedback +Status: Re-Opened
 [2016-07-12 14:12 UTC]
The test keeps failing under pgsql , please check it, as well as other RDBMS.
 [2016-07-25 15:28 UTC]
-Status: Re-Opened +Status: Closed
 [2016-07-25 15:28 UTC]
@jpauli PR 1999 updated to fix PostgreSQL and other major RDMS drivers.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 19 18:03:33 2021 UTC