# [PATCH]: Fix for PDOStatement::debugDumpParams()

- Thread: https://externals.io/message/49101
- Original archive: https://news-web.php.net/php.internals/49101
- Started by Jonah H. Harris on 2010-07-20T20:30:47+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #49101 — Jonah H. Harris — 2010-07-20T20:30:47+00:00

URL: https://externals.io/message/49101#49101

Per the documentation (
http://php.net/manual/en/pdostatement.debugdumpparams.php),
PDOStatement::debugDumpParams should be emitting the bind parameter value.
Currently however, it does not.  Accordingly, attached is a patch for 5.2
(which also applies cleanly to 5.3), which emits the bind parameter value.

While there are quite a few different ways to print and/or get a printable
version of the zval without having to convert the parameter to a string
in-place, I felt that zend_make_printable_zval was the most appropriate.
Feel free to correct me though ;-)

Also, the first example in the documentation is incorrect, as bindValue can
take at most three arguments.

In the example:

$sth->bindValue(':colour', $colour, PDO::PARAM_STR, 12);

should be:

$sth->bindValue(':colour', $colour, PDO::PARAM_STR);


-- 
Jonah H. Harris, VP of Database Administration
myYearbook.com

---

## #49102 — Pierre Joye — 2010-07-20T21:02:25+00:00

URL: https://externals.io/message/49101#49102 · In reply to: #49101

hi,

Can you open a bug and attach the patch to it please?

Thanks for your work,

On Tue, Jul 20, 2010 at 10:30 PM, Jonah H. Harris
<jonah.harris@gmail.com> wrote:
> Per the documentation
> (http://php.net/manual/en/pdostatement.debugdumpparams.php),
> PDOStatement::debugDumpParams should be emitting the bind parameter value.
> Currently however, it does not.  Accordingly, attached is a patch for 5.2
> (which also applies cleanly to 5.3), which emits the bind parameter value.
>
> While there are quite a few different ways to print and/or get a printable
> version of the zval without having to convert the parameter to a string
> in-place, I felt that zend_make_printable_zval was the most appropriate.
> Feel free to correct me though ;-)
>
> Also, the first example in the documentation is incorrect, as bindValue can
> take at most three arguments.
>
> In the example:
>
> $sth->bindValue(':colour', $colour, PDO::PARAM_STR, 12);
>
> should be:
>
> $sth->bindValue(':colour', $colour, PDO::PARAM_STR);
>
>
> --
> Jonah H. Harris, VP of Database Administration
> myYearbook.com
>
>
> --
> 
> 
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

---

## #49103 — johannes@php.net — 2010-07-20T21:14:40+00:00

URL: https://externals.io/message/49101#49103 · In reply to: #49102

Hi,


> hi,
> 
> Can you open a bug and attach the patch to it please?

and please add the bug in "unified diff" format (diff -u) which makes it
simpler to read.

Thanks!

johannes

> Thanks for your work,
> 
> On Tue, Jul 20, 2010 at 10:30 PM, Jonah H. Harris
> <jonah.harris@gmail.com> wrote:
> > […]
> 
> 
> 
> -- 
> Pierre
> 
> @pierrejoye | http://blog.thepimp.net | http://www.libgd.org

---

## #49104 — Jonah H. Harris — 2010-07-20T21:45:40+00:00

URL: https://externals.io/message/49101#49104 · In reply to: #49103

2010/7/20 Johannes Schlüter <johannes@php.net>

> > […]
>
>
> and please add the bug in "unified diff" format (diff -u) which makes it
> simpler to read.
>

Sorry about that.  I've updated the diff and submitted it as:

http://bugs.php.net/bug.php?id=52384

-- 
Jonah H. Harris
Blog: http://www.oracle-internals.com/
