Share
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.
Depends on what type variable
$fredis. If it’s an object,it will be passed as referencea pointer to the object (thanks NikiC) will be passed as value anyway as of PHP 5, so there is no need to explicitly do it. Thus far, the comment is correct-ish.For all other variable types, however, passing by reference needs to be explicitly specified and is not deprecated. Although it could be argued that it’s usually not good programming practice to use a lot of references in PHP.