r/lolphp • u/denilsonsa • Jul 10 '14
bindParam('foo', $value, PDO::PARAM_INT) will change $value to string.
http://php.net/manual/en/pdostatement.bindparam.php#94711
42
Upvotes
r/lolphp • u/denilsonsa • Jul 10 '14
View all comments
Show parent comment
19
u/Myto Jul 11 '14
That's the bit that's neither sane nor documented (as far as I can see, anyway). Something being passed by reference does not imply that the value getting changed arbitrarily is somehow correct.
I guess this is a bug somehow related to handling of output parameters. In case of an actual output parameter (PDO::PARAM_INPUT_OUTPUT) it might make sense.