|
Posted by Rik on 02/21/07 14:55
Daniel Loose wrote:
> Henk Verhoeven wrote:
>
>> When you replace
>> $this =3D 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 tha=
t =
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 functi=
on =
instead:
function evil_switch_object($name,$object){
$GLOBALS[$name] =3D $object;
}
Then again, I can not find the logic to switch WHY this is not done like=
:
$foo =3D new foo();//first class/object
$bar =3D new bar();//second class/object
$foo =3D $bar;//instead of $foo->linkbar($bar);
Could you go into further detail as to why this exact construct is neede=
d? =
Seems illogical...
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|