Thank you very much for the reply.
If I remember "correctly", C++ doesn't allow it but perl does, and I hoped PHP'd do as well.
Indeed, it can't be a good logic to define a var in a local scope and return its reference, but wonder how perl is ok with it.
So what I am doing is, rather than to return by reference, to define a var prior to the function call and pass it by reference.
Anyway, thank you very much for the tip.
-Jin