14 Jun
2008
14 Jun
'08
5:12 p.m.
On 14 Jun 2008, at 5:03 PM, Bob Pepin wrote:
On a side note, the next person designing a callback interface should also keep in mind that call_user_func can take array($classname, $methodname) as first argument. Would have avoided all the name clashes with callbacks in themes right now.
except when you use that format you can't pass references to functions, as it makes copies of everything chx wrote a simple call_user_func array replacement that passes references a few years ago. basically : function call($func, &$var1, &$var2, &$var3, &$var4, &$var5, & $var6 ... etc) { if (function_exists($func) { return $func($func, &$var1, &$var2, &$var3, &$var4, &$var5, & $var6 ... etc); } }