Example:
public function prepare($sql, &$p = NULL) {
p is assigned by reference. I’m not sure if I can assign safely NULL here as default. Is that ok in this case?
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.
Why would you want to have a default value for a parameter that is passed by reference? Isn’t the basic point of pass-by-reference that you can change the original variable in the caller’s scope? So if it has a default value, then you are not changing anything in the caller’s scope, so what’s the point?