Edit report at https://bugs.php.net/bug.php?id=70118&edit=1
ID: 70118
User updated by: chealer at gmail dot com
Reported by: chealer at gmail dot com
Summary: PDOStatement::execute manual says "values are
treated as PDO::PARAM_STR"
Status: Not a bug
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
I disagree. The sentence claims "All values are treated as PDO::PARAM_STR." Since
PDO::PARAM_STR is an integer, this needs to be valid if PDO::PARAM_STR is replaced by an integer.
Just like, if I claim that integers must be smaller than PHP_INT_MAX, it must be correct that
integer must be smaller than 2147483647 (or another integer).
Whether or not you consider this issue as a bug, please do reopen. The current situation is
definitely suboptimal.
Previous Comments:
------------------------------------------------------------------------
[2015-12-25 18:02:28] tpunt@php.net
We are not talking about what PDO::PARAM_STR is after it has been evaluated. We are talking about
what it *represents* ("the SQL CHAR, VARCHAR, or other string data type"). I still think
that this is therefore not a documentation problem.
If, however, you still disagree with me, then I will reopen this report and let another contributor
review it.
Thanks,
Tom
------------------------------------------------------------------------
[2015-12-24 20:27:28] chealer at gmail dot com
tpunt: technically, PDO::PARAM_STR *is* an integer.
There are strings in systems other than PHP, so the suggestion is valid, but feel free to be more
specific.
In any case, please explain why this was closed.
------------------------------------------------------------------------
[2015-12-19 18:00:07] tpunt@php.net
PDO::PARAM_STR does not *represent* an integer. It is *represented by* an integer, but it itself
represents "the SQL CHAR, VARCHAR, or other string data type"[1]. Given the
aforementioned, and that the default binding type is PDO::PARAM_STR, I still don't see the
sentence as being incorrect. If anything, I'd say it is more technically accurate than
mentioning "string", since we're not actually talking about strings in PHP, but
rather strings at the database level (like PDO::PARAM_NULL representing the SQL NULL data type,
rather than PHP's null).
[1]: http://uk1.php.net/manual/en/pdo.constants.php
------------------------------------------------------------------------
[2015-12-19 16:43:00] chealer at gmail dot com
tpunt, why was this closed?
Note that this is not about ambiguity, nor just about clarity. The sentence is simply wrong.
PDO::PARAM_STR represents an integer which I do not know, so the current form would translate to
something like "All values are treated as 1234.", which is at best the opposite of what
the sentence should claim.
------------------------------------------------------------------------
[2015-12-18 21:05:51] tpunt@php.net
Given that it's in the context of parameter binding, I think the current description is quite
unambiguous. Whilst it could be changed to read "as strings (PDO::PARAM_STR)", I
personally don't feel it adds any extra clarity to the sentence.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=70118
--
Edit this bug report at https://bugs.php.net/bug.php?id=70118&edit=1