Is there a difference in performance if an integer is bound as a string in a prepared PDO query? In Mysql the queries work either if the value is bound as an int or a string, but is there any difference in the performance, or any pitfalls when doing that?
$pdo = new PDO(
"mysql:host={$host};port={$port};dbname={$dbname};charset=utf8",
$username,
$password
);
$statement = $pdo->prepare("SELECT * FROM `table` WHERE `id` = :param");
// Is there any performance difference between the two rows below
$statement->bindValue(":param", 5);
$statement->bindValue(":param", 5, PDO::PARAM_INT);
$statement->execute();
Is there any difference between binding a parameter and specifying its type, or just quoting it as a string?