I'm stumped, Pete...
I tested some pass-by-ref stuff on my plugin, and it looks like it's doing exactly the reverse of what you said:
call_hook('receiving', array(&$var)) associated with either receiving($var) or receiving(&$var) WORK.
call_hook('receiving', array($var)) associated with either receiving($var) or receiving(&$var) DO NOT WORK.
You said that technically, the second solution is the right one, as long as &$var is used in receiving().
My concern stems from the fact that the call_hook function sends an ARRAY of variables, i.e. their VALUES. From the moment you send an array, the call_hook function can no longer access the array values as references, so it can't pass them as refs either...
It makes no sense to me.
Heck, I think we can also easily do away with the arrays.
Anyone knows anything about these? This is the first time I'm looking into plugins, really, and never used call_hook before for any reason whatsoever... ;)
I tested some pass-by-ref stuff on my plugin, and it looks like it's doing exactly the reverse of what you said:
call_hook('receiving', array(&$var)) associated with either receiving($var) or receiving(&$var) WORK.
call_hook('receiving', array($var)) associated with either receiving($var) or receiving(&$var) DO NOT WORK.
You said that technically, the second solution is the right one, as long as &$var is used in receiving().
My concern stems from the fact that the call_hook function sends an ARRAY of variables, i.e. their VALUES. From the moment you send an array, the call_hook function can no longer access the array values as references, so it can't pass them as refs either...
It makes no sense to me.
Heck, I think we can also easily do away with the arrays.
Anyone knows anything about these? This is the first time I'm looking into plugins, really, and never used call_hook before for any reason whatsoever... ;)




