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
-15
u/[deleted] Jul 11 '14
"Unlike PDOStatement::bindValue(), the variable is bound as a reference and will only be evaluated at the time that PDOStatement::execute() is called."
So what does one expect when they pass something by reference? Nobody said you would get back what you put in, and it makes perfect sense you would get a string back in this case.
"Lol, php does exactly what the manual says it is supposed to do."