
WTF are you trying to do? Usually if you see more than one time "magic" or "automagically" in the description of a piece of software, you known you're in trouble. Especially in combination with catch all+wrappers that allow you to leave stuff undefined. Do you even expect this to work? Sorry, no solution ;-) Kenny Billiau wrote:
Hi,
with the introduction of magic methods in php5, you could have a catch-all function called __call($function, $args) to kick in as soon as no matching function was found for a call. This is great, as I can write one baseclass with default functionality.
Secondly, in the main program I had something like this:
$q = start_event_queue(); $result1 = $q->push(an_event); $result2 = $q->push(another_event); ... $q->fire_events();
The $result# where references to the actual results, so they didn't get a relevant value before fire_events is fired. This is great too.
Thirdly, I wrapped above functionality so the events don't have to be defined .. even at runtime (yeah yeah, don't trip on this one ..). So I use the magic method __call to catch these. And here comes the problem...
The magic method __call doesn't return by reference! (ARGG!) There's even a 4 year old bug report about it: http://bugs.php.net/bug.php?id=30959&edit=1 Does anyone have an idea how I could automagically remove that extra level, or how I could administer the perfect solution illustrated in 'secondly'.
So, the question is: what the easiest way to administer this problem.
-Kenny ps: djeezes, what an explanation. pps: the Francis/Stephane solution: "Actually, we need to rewrite php to basicly fit perl better"