"what does it mean to start a php function with an ampersand?" Answer’s

0

An ampersand before a function name means the function will return a reference to a variable instead of the value.

Returning by reference is useful when you want to use a function to find to which variable a reference should be bound. Do not use return-by-reference to increase performance. The engine will automatically optimize this on its own. Only return references when you have a valid technical reason to do so.

See Returning References.

Wednesday, March 31, 2021
 
Anax
answered 11 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :