Daniel Loose wrote:
Henk Verhoeven wrote:
>When you replace
$this = func_get_arg(0);
return;
by
return func_get_arg(0);
you shoud get the same results in php4 and it should work in php5 too..
hm, thank you hank, however this is not the solution. of course it
removes the cannot reassign error msg, but gives another errror in
another line that wants to access the object (by using $this again)
("Call to a member function initLink() on a non-object ") I'm not an
expert here but I don't think that return func... does the same as the
original code... :-)
Well, unfortunately, I have no solution for you. Then again, I'm not that
well versed in OO, but this seems Bad Practise to me. A hidious, hidous,
hidous quick fix could be, if the object is a global, to use this function
instead:
function evil_switch_object($name,$object){
$GLOBALS[$name] = $object;
}
Then again, I can not find the logic to switch WHY this is not done like:
$foo = new foo();//first class/object
$bar = new bar();//second class/object
$foo = $bar;//instead of $foo->linkbar($bar);
Could you go into further detail as to why this exact construct is needed?
Seems illogical...
--
Rik Wasmus