Why do you have to specify variable names as a string value with this function? Why can’t I just use the variable name directly? This seems very silly to me.
Example:
db2_bind_param($prepared, 1, “foo1”);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As stated in the manual, it is the variable, to which the resource is bound to:
That way, you have a clean signature, because it always returns a boolean and no other data type. Other functions return either false or a resource. I believe, that the library has been ported from a strongly typed language like c or c++. In these languages, you can only specify one return type in the signature – something like
bool|resource db2_bind_param(...)does not work.In the end you are right: In a loosely typed language like PHP, you do not need it.