It is not clear from your text what you intend to assign to the variable $p. It could be either a reference to the function or the return value from the function. Your code correctly implements the latter. The other responders assume that is what you intend. Is it?