go to bug id or search bugs for
An array of values with as many elements as there are bound parameters in the SQL statement being executed. All values are treated as PDO::PARAM_STR.
From manual page: http://www.php.net/pdostatement.execute
PDO::PARAM_STR indicates string parameters. "as PDO::PARAM_STR" could read "as strings (PDO::PARAM_STR)", or simply "as strings".
Add a Patch
Add a Pull Request
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.
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.
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". 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).
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.
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.
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.
Your stance is that constants should be replaceable by the integer value they're represented by, and the sentence should still make sense.
By this notion, numerous other places in the manual are also incorrect. Take, for example, the following sentence from the error reporting page: "Enabling E_NOTICE during development has some benefits." The constant E_NOTICE is represented by the integer value 8, and so the sentence - from your stance - is nonsensical because you're saying that its equivalent to the following sentence: "Enabling 8 during development has some benefits."
This is not true. The constant E_NOTICE has meaning to the developer because it *represents* something. Replacing it with the value it is *represented by* will of course not make any sense, but it shouldn't need to either. We don't care what value it is represented by, only the meaning the constant has.
Anyway, I've reopened this at your request, but I still disagree with your opinion.
Thank you Tom.
I understand without effort the example you give. But I maintain that it is also technically incorrect. Instead of:
"Enabling E_NOTICE during development has some benefits."
it would be more clear to state, for example:
"Enabling notices (with E_NOTICE) during development has some benefits."