$value) { $type = PDO::PARAM_STR; if (in_array($value, [0, 1], true)) { $type = PDO::PARAM_INT; } $statement->bindValue( is_string($key) ? $key : $key + 1, $value, $type ); } } }